]> arthur.barton.de Git - appify.git/commitdiff
Use original script file name instead of "run.sh"
authorAlexander Barton <alex@barton.de>
Wed, 8 Apr 2015 09:48:20 +0000 (11:48 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 8 Apr 2015 09:48:20 +0000 (11:48 +0200)
This is nicer and we can wrap other scripts than shell: like Perl,
Python, Ruby, ...

appify.sh

index 45c6ea2c75104dc7d3261bab03c9531da1da5d8a..1ebf8bb1a20b3a69c3cef8e945d6594f2df7927d 100755 (executable)
--- a/appify.sh
+++ b/appify.sh
@@ -43,6 +43,8 @@ fi
 SCRIPT=$1
 TARGET=$2
 
 SCRIPT=$1
 TARGET=$2
 
+BASENAME=`basename "$SCRIPT"`
+
 if [ -e "$TARGET" ]; then
     echo "$TARGET exists, exiting" 1>&2
     exit 3
 if [ -e "$TARGET" ]; then
     echo "$TARGET exists, exiting" 1>&2
     exit 3
@@ -68,7 +70,7 @@ cat <<EOF >"$TARGET/Contents/Info.plist"
 <plist version="1.0">
 <dict>
     <key>CFBundleExecutable</key>
 <plist version="1.0">
 <dict>
     <key>CFBundleExecutable</key>
-    <string>run.sh</string>
+    <string>${BASENAME}</string>
     <key>CFBundleIconFile</key>
     <string></string>
     <key>CFBundleInfoDictionaryVersion</key>
     <key>CFBundleIconFile</key>
     <string></string>
     <key>CFBundleInfoDictionaryVersion</key>
@@ -83,5 +85,5 @@ cat <<EOF >"$TARGET/Contents/Info.plist"
 </plist>
 EOF
 
 </plist>
 EOF
 
-cp "$SCRIPT" "$TARGET/Contents/MacOS/run.sh"
-chmod 755 "$TARGET/Contents/MacOS/run.sh"
+cp "$SCRIPT" "$TARGET/Contents/MacOS/$BASENAME"
+chmod 755 "$TARGET/Contents/MacOS/$BASENAME"