Browse Source

Better shebang for Go scripts

master
Noah Petherbridge 4 years ago
parent
commit
2523888e3a
  1. 3
      home/bin/SimpleHTTPServer
  2. 2
      home/bin/gosh

3
home/bin/SimpleHTTPServer

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

2
home/bin/gosh

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

Loading…
Cancel
Save