-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.sh
executable file
·49 lines (41 loc) · 1.31 KB
/
bundle.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# Creates application bundles for use on Mac OS X.
if [ -z "$1" ]; then
echo "usage: `basename $0` BUNDLE-NAME"
exit 1
fi
bundle_name="$2"
bundle_path="$1"
if [ ! -d "${bundle_path}.app/Contents/MacOS" ]; then
mkdir -p "${bundle_path}.app/Contents/MacOS"
fi
if [ ! -d "${bundle_path}.app/Contents/Resources" ]; then
mkdir -p "${bundle_path}.app/Contents/Resources"
fi
if [ ! -f "${bundle_path}.app/Contents/PkgInfo" ]; then
echo -n "APPL????" > "${bundle_path}.app/Contents/PkgInfo"
fi
if [ ! -f "${bundle_path}.app/Contents/Info.plist" ]; then
cat > "${bundle_path}.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>English</string>
<key>CFBundleExecutable</key>
<string>${bundle_name}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFBundleIconFile</key>
<string>Icon.icns</string>
</dict>
</plist>
EOF
fi