X-Git-Url: https://arthur.barton.de/gitweb/?p=appify.git;a=blobdiff_plain;f=appify.sh;h=1ebf8bb1a20b3a69c3cef8e945d6594f2df7927d;hp=ca8962f4357534942edc5ff7074f024294125ddb;hb=97524bbed75009a29c9f4bcbd167c94d8624cc6d;hpb=f905af9f204534a0a4c382a5c0eeae8f3de64612 diff --git a/appify.sh b/appify.sh index ca8962f..1ebf8bb 100755 --- a/appify.sh +++ b/appify.sh @@ -1,23 +1,20 @@ #!/bin/bash - # # appify -- convert your non-interactive shell script into a Mac OS X application # Copyright (C) 2010 Adam Backstrom -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. args=$(getopt h $*) @@ -46,7 +43,9 @@ fi SCRIPT=$1 TARGET=$2 -if [ -d "$TARGET" ]; then +BASENAME=`basename "$SCRIPT"` + +if [ -e "$TARGET" ]; then echo "$TARGET exists, exiting" 1>&2 exit 3 fi @@ -71,7 +70,7 @@ cat <"$TARGET/Contents/Info.plist" CFBundleExecutable - run.sh + ${BASENAME} CFBundleIconFile CFBundleInfoDictionaryVersion @@ -86,5 +85,5 @@ cat <"$TARGET/Contents/Info.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"