Skip to content

Instantly share code, notes, and snippets.

@ebittleman
Created May 20, 2015 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebittleman/1af57e1d8f1fe905769e to your computer and use it in GitHub Desktop.
Save ebittleman/1af57e1d8f1fe905769e to your computer and use it in GitHub Desktop.
goapp bash script for goapp in windows
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
GOROOT=$DIR/goroot
APPENGINE_DEV_APPSERVER=$DIR/dev_appserver.py
GOARCH=
GOBIN=
GOOS=
# Note that due to the nature of BAT files, if the optional
# "--dev_appserver /path/to/dev_appserver.py" arguments are
# provided, they must appear exactly as the first and second
# arguments after the command name for this to work properly.
# Also note that shifting args messes up the value of $DIR.
EXENAME=$(basename $0).exe
if [ "$1" = "--dev_appserver" ]; then
APPENGINE_DEV_APPSERVER=$2
shift && shift
fi
if [ -z ${GOPATH+x} ]; then GOPATH=$DIR/gopath; fi
$GOROOT/bin/$EXENAME $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment