Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import os
- files = [
- ]
- for f in files:
- cwd = os.getcwd()
- path = os.path.dirname(f)
- op = ""
- for s in range(path.count("/")+1):
- op = os.path.join(op, os.pardir)
- import fileinput
- for line in fileinput.input(f, inplace = 1):
- output = line.replace("const logger = require('winston');", "const { logger } = require('%s/lib/logger')" % (op))
- output = output.rstrip()
- print(output)
Add Comment
Please, Sign In to add comment