Skip to content

Instantly share code, notes, and snippets.

@jbott jbott/

forked from advorak/
Last active Aug 29, 2015
What would you like to do?
appify — create the simplest possible Mac app from a shell script (adds an application icon) (Working with ZSH with spaces in the name)
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
appify v3.0.0 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 <>
Modified by Andrew Dvorak <>
exit; fi
# OSX_VERSION is currently unused, though knowing this may help, since the
# GenericApplicationIcon.icns file may be located elsewhere pre-10.6.x
OSX_VERSION=`sw_vers -productVersion`
APPNAME=${2:-$(basename "$1" ".sh")}
if [ -a "$" ]; then
echo "$PWD/$ already exists :("
exit 1
mkdir -p "$DIR/MacOS"
mkdir -p "$DIR/Resources"
# Copy Apple's GenericApplicationIcon to our application.
# - TODO: provide command-line options for specifying an icon to use
# (maybe even allow the user to specify an)
cp "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns" "$DIR/Resources/$APPNAME.icns"
cp "$1" "$DIR/MacOS/$APPNAME"
chmod +x "$DIR/MacOS/$APPNAME"
cat <<EOF > "$DIR/Info.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
echo "$PWD/$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.