Browse Source

update Bucket_Game mods correctly; add sponge and metatools fork

resolves #325 resolves #326
master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
b0383d6f35
  1. 45
      webapp/install-mts.sh

45
webapp/install-mts.sh

@ -15,6 +15,25 @@ $1
END END
exit 1 exit 1
} }
install_git_mod_here(){
git_url="$1"
mod_name="$2"
if [ -z "$git_url" ]; then
customDie "install_git_mod_here requires a URL."
fi
if [ -z "$mod_name" ]; then
customDie "install_git_mod_here requires a mod name as the second parameter."
fi
if [ ! -d "$mod_name" ]; then
git clone "$git_url" "$mod_name"
else
cd "$mod_name" || customDie "(install_git_mod_here) 'cd \"$mod_name\"' failed in '`pwd`'"
echo "* updating '`pwd`' from git..."
git pull || echo "WARNING: (install_git_mod_here) 'git pull' failed in '`pwd`'"
cd .. || customDie "(install_git_mod_here) 'cd ..' failed in '`pwd`'"
fi
}
enable_server=true enable_server=true
dest_programs="$HOME" dest_programs="$HOME"
#NOTE: $HOME is still used further down, for $HOME/.* and $HOME/i_am_dedicated_minetest_server flag file (which can be empty) #NOTE: $HOME is still used further down, for $HOME/.* and $HOME/i_am_dedicated_minetest_server flag file (which can be empty)
@ -168,6 +187,7 @@ dest_enliven="$dest_programs/minetest/games/ENLIVEN"
skins_dst="$dest_enliven/mods/codercore/coderskins/textures" skins_dst="$dest_enliven/mods/codercore/coderskins/textures"
skins_bak="$HOME/Backup/ENLIVEN/mods/codercore/coderskins/textures" skins_bak="$HOME/Backup/ENLIVEN/mods/codercore/coderskins/textures"
official_game_mod_list="coderbuild codercore coderedit coderfood codermobs decorpack mtmachines" official_game_mod_list="coderbuild codercore coderedit coderfood codermobs decorpack mtmachines"
dest_enliven_mods="$dest_enliven/mods"
if [ "@$enable_clean" = "@true" ]; then if [ "@$enable_clean" = "@true" ]; then
echo "* cleaning destination..." echo "* cleaning destination..."
if [ -d "$dest_official_game" ]; then if [ -d "$dest_official_game" ]; then
@ -184,11 +204,26 @@ if [ "@$enable_clean" = "@true" ]; then
fi fi
for var in $official_game_mod_list for var in $official_game_mod_list
do do
echo " - erasing '$dest_enliven/$var'..." if [ -d "$dest_enliven_mods/$var" ]; then
rm -Rf "$dest_enliven/$var" echo " - erasing '$dest_enliven_mods/$var'..."
rm -Rf "$dest_enliven_mods/$var" || customDie "rm -Rf \"$dest_enliven_mods/$var\" failed"
# See rsync further down for installation of each of these
else
echo " - already clean: no '$dest_enliven_mods/$var'..."
fi
done done
fi fi
fi fi
enliven_warning=""
if [ -d "$dest_enliven_mods" ]; then
pushd "$dest_enliven_mods" || customDie "'pushd \"$dest_enliven_mods\"' failed."
install_git_mod_here https://github.com/BenjieFiftysix/sponge.git sponge
install_git_mod_here https://github.com/poikilos/metatools.git metatools
popd || customDie "'popd' failed."
else
enliven_warning="$enliven_warning* WARNING: Installing ENLIVEN mods was skipped since '$dest_enliven_mods' does not exist."
fi
if [ ! -z "$link_target" ]; then if [ ! -z "$link_target" ]; then
install_dest="$link_target" install_dest="$link_target"
echo "* detected that $virtual_dest is a symlink to $link_target" echo "* detected that $virtual_dest is a symlink to $link_target"
@ -201,7 +236,7 @@ if [ ! -z "$link_target" ]; then
fi fi
else else
echo "Installing minetest directory to '$dest_programs'..." echo "Installing minetest directory to '$dest_programs'..."
rsync -rt minetest/ $install_dest || customDie "Cannot rsync files from installer data `pwd`/minetest/ to $install_dest" rsync -rt --info=progress2 minetest/ $install_dest || customDie "Cannot rsync files from installer data `pwd`/minetest/ to $install_dest"
fi fi
if [ ! -f "$dest_flag_file" ]; then if [ ! -f "$dest_flag_file" ]; then
customDie "ERROR: not complete--couldn't install binary as '$dest_flag_file'" customDie "ERROR: not complete--couldn't install binary as '$dest_flag_file'"
@ -219,7 +254,7 @@ else
for mod_name in $official_game_mod_list for mod_name in $official_game_mod_list
do do
echo " - updating $mod_name..." echo " - updating $mod_name from '$flag_dir/mods/$mod_name' to '$dest_programs/minetest/games/ENLIVEN/mods'..."
rsync -rt --delete "$flag_dir/mods/$mod_name" "$dest_programs/minetest/games/ENLIVEN/mods" rsync -rt --delete "$flag_dir/mods/$mod_name" "$dest_programs/minetest/games/ENLIVEN/mods"
done done
# cp -f "$flag_dir/mods/LICENSE" "$dest_programs/minetest/games/ENLIVEN/mods/LICENSE" # cp -f "$flag_dir/mods/LICENSE" "$dest_programs/minetest/games/ENLIVEN/mods/LICENSE"
@ -467,6 +502,6 @@ ERROR: enable_run_after_compile is true, but
END END
fi fi
fi fi
echo "$enliven_warning"
echo echo
echo echo

Loading…
Cancel
Save