#!/bin/bash
#
-# appify -- convert your non-interactive shell script into a Mac OS X application
+# appify -- convert non-interactive shell script into Mac OS X applications
# Copyright (C) 2010 Adam Backstrom
+# Copyright (C) 2015 Alexander Barton <alex@barton.de>
+#
# 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
args=$(getopt h $*)
function usage {
- echo "Usage: $0 [-h] script.sh target.app"
+ echo "Usage: $0 [-h] <script.sh> <target.app>"
exit 2
}
BASENAME=`basename "$SCRIPT"`
+if [ ! -r "$SCRIPT" ]; then
+ echo "$SCRIPT isn't readable!" 1>&2
+ exit 3
+fi
+
if [ -e "$TARGET" ]; then
- echo "$TARGET exists, exiting" 1>&2
+ echo "$TARGET exists!" 1>&2
exit 3
fi