diff --git a/changelog.md b/changelog.md index 31a868e..21f09e5 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [git] - 2020-03-11 +### Changed +- Use $HOME/.config/EnlivenMinetest to store downloads. + +### Fixed +- Use instead of `-ne` for comparing strings. + + ## [git] - 2020-03-11 ### Changed - Generate readme-ENLIVEN.md `game-release.rc` when building ENLIVEN-mtg diff --git a/install-mts.sh b/install-mts.sh index fdf50b8..1c8becc 100755 --- a/install-mts.sh +++ b/install-mts.sh @@ -4,6 +4,9 @@ echo echo echo echo "Starting install..." +MY_NAME="install-mts.sh" +config_path="$HOME/.config/EnlivenMinetest" + date customDie() { cat < $settings_dump @@ -492,8 +512,8 @@ else fi popd echo "* finished compiling." -if [ -f "$extracted_dir/release.txt" ]; then - versionLine=`cat $extracted_dir/release.txt` +if [ -f "$extracted_path/release.txt" ]; then + versionLine=`cat $extracted_path/release.txt | grep Release` echo " - version: $versionLine" fi if [ "@$enable_run_after_compile" = "@true" ]; then diff --git a/reset-minetest-install-source.sh b/reset-minetest-install-source.sh index cd2cb26..2309b5e 100755 --- a/reset-minetest-install-source.sh +++ b/reset-minetest-install-source.sh @@ -4,8 +4,16 @@ echo echo echo "Starting cleanup and library rebuild..." date +MY_NAME="reset-minetest-install-source.sh" +config_path=$HOME/.config/EnlivenMinetest + zip_name=linux-minetest-kit.zip extracted_name=linux-minetest-kit +config_path=~/.config/EnlivenMinetest +if [ ! -d "$config_path" ]; then + mkdir -p "$config_path" +fi + in_use_name=minetest #not reliable with bash -e (if not running, check throws error): #running=`ps ax | grep -v grep | grep $in_use_name | wc -l` @@ -61,7 +69,7 @@ if [ "@$installed_version" = "@$available_version" ]; then echo "You already have the latest version installed." exit 1 fi -if [ "@$compiled_version" -ne "@$installed_version" ]; then +if [ "@$compiled_version" != "@$installed_version" ]; then echo "ERROR: You have not yet installed version $compiled_version which you already compiled (you have installed $installed_version)." echo "You should run ./install-mts.sh instead (with --client option if you want more than minetestserver)" exit 2 @@ -75,6 +83,7 @@ do customDie "Invalid argument: $var" fi done +cd "$config_path" || customDie "[$MY_NAME] cd \"$config_path\" failed." if [ -d "$extracted_name" ]; then if [ "`ls -lR screenshots/*.png | wc -l`" -gt 0 ]; then mv screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_name/minetest/bin/*.png" @@ -116,7 +125,7 @@ echo echo cd .. echo "Check libraries.log for errors, then..." -echo "- Run the following manually for SERVER only (no graphical client):" +echo "- Run the following manually for SERVER only (no graphical client unless an old copy of ~/minetest/bin/minetest is detected):" echo " bash install-mts.sh" echo "- Run the following manually for both minetestserver and minetest:" echo " bash install-mts.sh --client" diff --git a/versionize.sh b/versionize.sh index 0f04970..daaf191 100755 --- a/versionize.sh +++ b/versionize.sh @@ -1,6 +1,9 @@ #!/bin/bash echo echo "Collecting version..." +MY_NAME="versionize.sh" +config_path=$HOME/.config/EnlivenMinetest +cd "$config_path" || customDie "[$MY_NAME] cd \"$config_path\" failed." if [ -z "$original_src_path" ]; then original_src_path="$1" fi @@ -48,13 +51,13 @@ customDie() { destroy_msg="" # src_path: extracted name (always linux-mintetest-kit unless source is # archive, in which case src_path is detected) -src_path="linux-minetest-kit" -versions_path="$HOME/git/EnlivenMinetest/webapp/minetest-versions" +src_path="$config_path/linux-minetest-kit" +versions_path="$config_path/minetest-versions" if [ ! -d "$versions_path" ]; then mkdir -p "$versions_path" || customDie "mkdir $versions_path FAILED" fi src_name="" -try_path="`pwd`/$original_src_path" +try_path="$config_path/$original_src_path" if [ -f "$original_src_path" ]; then echo "* detected file param..." elif [ -d "$original_src_path" ]; then