Skip to content

Instantly share code, notes, and snippets.

@dbergey
Forked from subtleGradient/appify
Created November 12, 2010 17:53
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 dbergey/674431 to your computer and use it in GitHub Desktop.
Save dbergey/674431 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
APPNAME=${1:-Untitled}
if [[ -a "$APPNAME.app" ]]; then
echo "App already exists :'(" >&2
echo "$PWD/$APPNAME.app"
exit 1
fi
mkdir -p "$APPNAME.app/Contents/MacOS"
touch "$APPNAME.app/Contents/MacOS/$APPNAME"
chmod +x "$APPNAME.app/Contents/MacOS/$APPNAME"
DONE=false
until $DONE ;do
read || DONE=true
echo "$REPLY" >> "$APPNAME.app/Contents/MacOS/$APPNAME"
done
echo "$PWD/$APPNAME.app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment