From 88fae611b53965a9c78c29751587520561690979 Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Sun, 17 Mar 2019 21:57:21 -0400 Subject: [PATCH] improve interim install --- webapp/install-mts.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) mode change 100644 => 100755 webapp/install-mts.sh diff --git a/webapp/install-mts.sh b/webapp/install-mts.sh old mode 100644 new mode 100755 index ec8b4bf..bf6da6a --- a/webapp/install-mts.sh +++ b/webapp/install-mts.sh @@ -6,7 +6,19 @@ if [ ! -d "$flag_dir" ]; then exit 1 fi cd "$extracted_name" +extra_options="" +if [ "@$1" = "@--client" ]; then + extra_options="--client" +fi +flag_icon="$HOME/Desktop/org.minetest.minetest.desktop" flag_file="minetest/bin/minetestserver" +if [ -f "$flag_icon" ]; then + extra_options="--client" + echo "automatically adding --client to compile since detected" + echo "'$flag_icon'--press Ctrl C to cancel..." + flag_file="minetest/bin/minetest" + sleep 2 +fi #if [ -f "$flag_file" ]; then #rm -f "$flag_file" #fi @@ -20,11 +32,11 @@ else if [ -f "mtcompile-program.pl" ]; then # perl mtcompile-program.pl build >& program.log echo "Compiling via perl..." - perl mtcompile-program.pl build --server >& program.log + perl mtcompile-program.pl build --server $extra_options >& program.log else # NOTE: no pl in $extracted_name, assuming bash: echo "Compiling via bash..." - bash -e mtcompile-program.sh build >& program.log + bash -e mtcompile-program.sh build --server $extra_options >& program.log fi fi if [ ! -f "$flag_file" ]; then @@ -39,6 +51,11 @@ if [ -f "$flag_file" ]; then echo "ERROR: not complete since can't move old '$flag_file'" exit 1 fi +if [ ! -d minetest ]; then + echo "ERROR: can't install since missing `pwd`/minetest" + exit 1 +fi +echo "Installing minetest to '$HOME'..." rsync -rt minetest $HOME if [ ! -f "$flag_file" ]; then echo "ERROR: not complete--couldn't create '$flag_file'"