Guest User

Untitled

a guest
Oct 23rd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import os
  3.  
  4. files = [
  5.  
  6. ]
  7.  
  8. for f in files:
  9. cwd = os.getcwd()
  10. path = os.path.dirname(f)
  11.  
  12. op = ""
  13.  
  14. for s in range(path.count("/")+1):
  15. op = os.path.join(op, os.pardir)
  16.  
  17. import fileinput
  18.  
  19. for line in fileinput.input(f, inplace = 1):
  20. output = line.replace("const logger = require('winston');", "const { logger } = require('%s/lib/logger')" % (op))
  21. output = output.rstrip()
  22. print(output)
Add Comment
Please, Sign In to add comment