diff options
Diffstat (limited to 'includes/generic-includes.sh')
-rw-r--r-- | includes/generic-includes.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 51cffcb..1e0e89d 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -56,13 +56,13 @@ function diequietly function setuptmp { - rm -rf $TMPDIR - mkdir -p $TMPDIR || die + rm -rf "$TMPDIR" + mkdir -p "$TMPDIR" || die } function cleanuptmp { - rm -rf $TMPDIR + rm -rf "$TMPDIR" } function checkforbin @@ -71,7 +71,7 @@ function checkforbin retstatus=0 while [ "$1" != "" ]; do - binname=$1 + binname="$1" which "$binname" &> /dev/null if [ $? -ne 0 ]; then @@ -110,13 +110,13 @@ function usage { echo "Usage:" $0 "[-i installdir] [-p patchdir] [-c cdmount] [-l language]" echo -e " -i installdir is the directory to install to." - echo -e " default:" $TARGETDIR + echo -e " default: ${TARGETDIR} (changes per game)" echo -e " -c cdmount is the mount location of the cd drive used." - echo -e " default:" $CDMOUNT + echo -e " default: ${CDMOUNT}" echo -e " -p patchdir is an optional directory containing patch files." - echo -e " default:" $PATCHDIR + echo -e " default: ${PATCHDIR}" echo -e " -l language can be one of English, Spanish, French, German, Italian or Language Independant" - echo -e " default:" $LANGUAGE + echo -e " default: ${LANGUAGE}" # TODO: Add option to show and select all known BG1 versions } @@ -150,3 +150,12 @@ function copylower cp -f "$(echo $1|tr A-Z a-z)" "$2" fi } + +function move_and_remove +{ + # usage: move_and_remove source destination + # copies the files in the source directory to the destination. + mkdir -p "$2" || die + cp -R "$1/"* "$2" || die + rm -r "$1" +} |