1
0

Better shebang for Go scripts

This commit is contained in:
Noah 2017-12-19 12:21:03 -08:00
parent 6df07c0685
commit 2523888e3a
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env gosh ///bin/true && exec /usr/bin/env gosh "$0" "$@"
// vim:set ft=go:
package main package main
// SimpleHTTPServer is a simple Go static file server, similar to the Python // SimpleHTTPServer is a simple Go static file server, similar to the Python

View File

@ -39,7 +39,7 @@ def main():
# Write it to a temp file, sans shebang. # Write it to a temp file, sans shebang.
temp = tempfile.NamedTemporaryFile(delete=False, suffix=".go") temp = tempfile.NamedTemporaryFile(delete=False, suffix=".go")
temp.write(fh.read().strip()) temp.write(fh.read().strip().encode())
temp.close() temp.close()
# Call it. # Call it.