Deleted obsolete build script apply_exports_hack.py.

This script was a hack used to make the JavaScript code
work on both Node.js and in browsers. Now we build separate
versions of the code for both environments, so we no longer
need this script.
This commit is contained in:
Don Cross
2021-03-06 16:26:11 -05:00
parent a8c970ba78
commit cb50beb217

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env python3
import sys
if __name__ == '__main__':
if len(sys.argv) != 2:
print('USAGE: apply_exports_hack.py js_filename')
sys.exit(1)
filename = sys.argv[1]
with open(filename, 'rt') as infile:
text = infile.read()
find = "})(this.Astronomy = {});"
repl = "})(typeof exports==='undefined' ? (this.Astronomy={}) : exports);"
if text.find(find) < 0:
print('ERROR: could not find target text in file: {}'.format(filename))
sys.exit(1)
text = text.replace(find, repl)
with open(filename, 'wt') as outfile:
outfile.write(text)
print('apply_exports_hack.py: patched file {}'.format(filename))
sys.exit(0)