summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorNick Daly <myownlittlworld@hotmail.com>2009-06-07 13:54:16 -0500
committerNick Daly <myownlittlworld@hotmail.com>2009-06-07 13:54:16 -0500
commit8340056fb51fb3539bbc63b14b551c6574309420 (patch)
treebc7495b11d2fc3161c76baf364369ee80d71f77e /includes
parent84a273cfaed391a8008396e595cc1fa347aa2a5c (diff)
downloadgemrb-gameinstallers-8340056fb51fb3539bbc63b14b551c6574309420.tar.bz2
gemrb-gameinstallers-8340056fb51fb3539bbc63b14b551c6574309420.zip
Fixing previous bad commit. Made copylower safer.
Diffstat (limited to 'includes')
-rw-r--r--includes/generic-includes.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh
index 3e3ef36..b58177b 100644
--- a/includes/generic-includes.sh
+++ b/includes/generic-includes.sh
@@ -141,14 +141,16 @@ function parseargs
function copylower
{
# usage: copylower source destination
+ mkdir -p "$2"
+
if [ -d "$1" ]; then
for filename in $(find "$1" -type f); do
lowerpath="$(echo $filename|gawk -F '$1' '{print $2}'|tr A-Z a-z)"
- cp -f "$filename" "$2/$lowerpath" || die
+ cp -f "$filename" "${2}/${lowerpath}" || die
done
elif [ -f "$1" ]; then
lowername="$(basename $1|tr A-Z a-z)"
- cp -f "$1" "$2"/$lowername
+ cp -f "$1" "${2}/${lowername}"
fi
}