Last active — forked from subtleGradient/appify

appify — create the simplest possible Mac app from a shell script

  • Download Gist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X -
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"`
Note that you cannot rename appified apps. If you want to give your app
a custom name, use the second argument:
`basename "$0"` "My App"
Copyright (c) Thomas Aylott <>
Modified by Mathias Bynens <>
exit; fi
APPNAME=${2:-$(basename "$1" ".sh")}
if [ -a "$" ]; then
echo "$PWD/$ already exists :("
exit 1
mkdir -p "$DIR"
cp "$1" "$DIR/$APPNAME"
chmod +x "$DIR/$APPNAME"
echo "$PWD/$"

@mathiasbynens FTW!
Much better.

I tried to make it work using cp before but couldn't get it working for some strange reason. I forget the original issue I ran into.

Feel free to backport these changes into your original gist if you like! It’s still your script :) I’ll update my blog post accordingly.

Great script guys! Thanks!

I used this today to on a .sh script of mine. When launching the app it states: "You can't open the application...because PowerPC applications are no longer supported. I'm running Mountain Lion. My .sh script runs fine natively, it is small and just uses a couple curl lines to download some tar.gz files. Any ideas?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.