Skip to content

Instantly share code, notes, and snippets.

@eisisig
Last active November 12, 2015 20:16
Show Gist options
  • Save eisisig/0c4eced8e8486f755ed0 to your computer and use it in GitHub Desktop.
Save eisisig/0c4eced8e8486f755ed0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# usage:
# appify your-shell-script.sh "Your App Name"
# example script
# #!/usr/bin/env bash
# cd ~/Projects/Foo/
# python -m SimpleHTTPServer 8080 &> /dev/null &
# open http://localhost:8080/
APPNAME=${2:-$(basename "$1" ".sh")}
DIR="$APPNAME.app/Contents/MacOS"
if [ -a "$APPNAME.app" ]; then
echo "$PWD/$APPNAME.app already exists :("
exit 1
fi
mkdir -p "$DIR"
cp "$1" "$DIR/$APPNAME"
chmod +x "$DIR/$APPNAME"
echo "$PWD/$APPNAME.app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment