Skip to content

Instantly share code, notes, and snippets.

@framkant
Last active August 29, 2015 14:11
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 framkant/1c135f8d6d012ceceda6 to your computer and use it in GitHub Desktop.
Save framkant/1c135f8d6d012ceceda6 to your computer and use it in GitHub Desktop.
make a mac os x bundle file structure
#!/bin/sh
# make a basic bundle / folder structure for macosx.
# public domain (by filip wanstrom)
if [ -z "$1" ]; then
echo "usage: `basename $0` <name-of-bundle>"
exit 1
fi
bundleName="$1"
if [ ! -d "${bundleName}.app/Contents/MacOS" ]; then
mkdir -p "${bundleName}.app/Contents/MacOS"
fi
if [ ! -d "${bundleName}.app/Contents/Resources" ]; then
mkdir -p "${bundleName}.app/Contents/Resources"
fi
if [ ! -f "${bundleName}.app/Contents/PkgInfo" ]; then
echo -n "APPL????" > "${bundleName}.app/Contents/PkgInfo"
fi
if [ ! -f "${bundleName}.app/Contents/Info.plist" ]; then
cat > "${bundleName}.app/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${bundleName}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${bundleName}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
EOF
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment