diff --git a/reset-minetest-install-source.sh b/reset-minetest-install-source.sh index ec4e05a..f6a34e3 100755 --- a/reset-minetest-install-source.sh +++ b/reset-minetest-install-source.sh @@ -90,19 +90,19 @@ if [ -d "$extracted_path" ]; then # NOTE: ls -lR provides a count, so it is not suitable unless output # is parsed. `| wc -l` is easier (word count). screenshot_count=0 - if [ -d $extracted_path/screenshots/ ]; then + if [ -d $extracted_path/screenshots ]; then screenshot_count=`ls $extracted_path/screenshots/*.png | wc -l` fi if [ $screenshot_count -gt 0 ]; then - mv $extracted_path/screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_name/minetest/bin/*.png" + mv $extracted_path/screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_path/screenshots/*.png" rmdir --ignore-fail-on-non-empty "$extracted_path/screenshots" fi - if [ `ls $extracted_name/minetest/bin/*.png | wc -l` -gt 0 ]; then + if [ `ls $extracted_path/minetest/bin/*.png | wc -l` -gt 0 ]; then # if [ ! -d screenshots ]; then mkdir screenshots; fi # NOTE: system-wide install of minetest puts screenshots in ~/ (cwd) - mv $extracted_name/minetest/bin/*.png ~/ || customDie "can't move screenshots from $extracted_name/minetest/bin/*.png" + mv $extracted_path/minetest/bin/*.png ~/ || customDie "can't move screenshots from $extracted_path/minetest/bin/*.png" fi - rm -Rf "$extracted_name" || customDie "can't remove $extracted_name" + rm -Rf "$extracted_path" || customDie "can't remove $extracted_name" fi if [ "@$enable_offline" = "@true" ]; then @@ -110,11 +110,11 @@ if [ "@$enable_offline" = "@true" ]; then customDie "* Offline install is impossible without '`pwd`/$zip_name'." fi else - wget -O $zip_name $url/$zip_name || customDie "no $zip_name at $url" + wget -O "$EM_CONFIG_PATH/$zip_name" $url/$zip_name || customDie "no $zip_name at $url" fi unzip -u $zip_name || customDie "Can't unzip $zip_name" -cd "$extracted_name" -cat "$extracted_name/release.txt" +cd "$extracted_name" || customDie "Unzipping \"$zip_name\" in \"`pwd`\" did not result in a readable directory named \"$extracted_name\" there." +cat "$extracted_path/release.txt" echo "compiling libraries..." date start=`date +%s`