Created
February 2, 2020 10:46
-
-
Save uzeyirdestan/f6f5b6c9de3c9e9ca083653615c47527 to your computer and use it in GitHub Desktop.
React index.android.bundle nicer script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#React index.android.bundle nicer script | |
#You need to install jsnice tool in order to work. | |
#Author: Uzeyir Destan | |
import sys | |
import os | |
if len(sys.argv) < 2: | |
print("Usage is %s <file to parse>" % (sys.argv[0])) | |
sys.exit(0) | |
i=0 | |
with open(sys.argv[1]) as fp: | |
line = fp.readline() | |
print(line) | |
name = "%s.%04d"%(sys.argv[1],i) | |
tmp = open(name,"w") | |
tmp.write(line) | |
tmp.close() | |
command="jsnice %s | tee -a source.js" % name | |
os.system(command) | |
while line: | |
i = i + 1 | |
line = fp.readline() | |
print(line) | |
name = "%s.%04d"%(sys.argv[1],i) | |
tmp = open(name,"w") | |
tmp.write(line) | |
tmp.close() | |
command="jsnice %s | tee -a source.js" % name | |
os.system(command) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment