Browse Source

improve interim install

master
poikilos 6 years ago
committed by Jacob Gustafson
parent
commit
88fae611b5
  1. 21
      webapp/install-mts.sh

21
webapp/install-mts.sh

@ -6,7 +6,19 @@ if [ ! -d "$flag_dir" ]; then
exit 1 exit 1
fi fi
cd "$extracted_name" 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" 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 #if [ -f "$flag_file" ]; then
#rm -f "$flag_file" #rm -f "$flag_file"
#fi #fi
@ -20,11 +32,11 @@ else
if [ -f "mtcompile-program.pl" ]; then if [ -f "mtcompile-program.pl" ]; then
# perl mtcompile-program.pl build >& program.log # perl mtcompile-program.pl build >& program.log
echo "Compiling via perl..." echo "Compiling via perl..."
perl mtcompile-program.pl build --server >& program.log perl mtcompile-program.pl build --server $extra_options >& program.log
else else
# NOTE: no pl in $extracted_name, assuming bash: # NOTE: no pl in $extracted_name, assuming bash:
echo "Compiling via 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
fi fi
if [ ! -f "$flag_file" ]; then 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'" echo "ERROR: not complete since can't move old '$flag_file'"
exit 1 exit 1
fi 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 rsync -rt minetest $HOME
if [ ! -f "$flag_file" ]; then if [ ! -f "$flag_file" ]; then
echo "ERROR: not complete--couldn't create '$flag_file'" echo "ERROR: not complete--couldn't create '$flag_file'"

Loading…
Cancel
Save