Changed method of expanding download directory

Found a somewhat nicer and more compatible way of expanding a path which handles ~ and spaces.
This commit is contained in:
Henric Andersson 2015-09-30 12:57:01 -07:00
commit c280afea94

View file

@ -133,13 +133,11 @@ fi
# Remove any ~ or other oddness in the path we're given
eval pushd "${DOWNLOADDIR}" > /dev/null 2>/dev/null
if [ $? -ne 0 ]; then
DOWNLOADDIR="$(eval cd ${DOWNLOADDIR/ /\\ } ; if [ $? -eq 0 ]; then pwd; fi)"
if [ -z "${DOWNLOADDIR}" ]; then
echo "Error: Download directory does not exist or is not a directory"
exit 1
fi
DOWNLOADDIR="$(pwd)"
popd > /dev/null
# Detect if we're running on redhat instead of ubuntu
REDHAT=no;