Last active
November 12, 2015 20:16
-
-
Save eisisig/0c4eced8e8486f755ed0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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