From c280afea94814db61d46f42106575dc680da3ecb Mon Sep 17 00:00:00 2001 From: Henric Andersson Date: Wed, 30 Sep 2015 12:57:01 -0700 Subject: [PATCH] Changed method of expanding download directory Found a somewhat nicer and more compatible way of expanding a path which handles ~ and spaces. --- plexupdate.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index 792e8c9..053e3c6 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -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;