Browse Source

Change an indent and a function name.

master
poikilos 4 years ago
parent
commit
5f923e2396
  1. 28
      minetestenv.rc

28
minetestenv.rc

@ -1,7 +1,7 @@
err_txt=$HOME/err-enliven.txt
echo "# * minetestenv.rc started `date`" > "$err_txt"
customDie() {
customExit() {
echo
errorLevel=1
if [ -z "$2" ]; then
@ -147,7 +147,7 @@ show_changes="true"
if [ "$SCRIPT" = "/bin/bash" ]; then
SCRIPT=minetestenv.rc
if [ ! -f "$SCRIPT" ]; then
customDie "ERROR: could not find self (need location of self in order to get SCRIPTPATH and then REPO_PATH in order for patches directory to be found."
customExit "ERROR: could not find self (need location of self in order to get SCRIPTPATH and then REPO_PATH in order for patches directory to be found."
fi
fi
# Absolute path this script is in, thus /home/user/bin
@ -182,7 +182,7 @@ fi
if [ ! -d "$PATCHES_PATH" ]; then
echo
echo
customDie "ERROR: could not find patches such as in $PATCHES_PATH"
customExit "ERROR: could not find patches such as in $PATCHES_PATH"
fi
# NOTE: minetest mods (other than 0.4.16 client-side mods) are ALWAYS ONLY installed on server, unless you need them for singleplayer
USR_SHARE_MINETEST=/usr/share/games/minetest
@ -311,7 +311,7 @@ else
#fi
fi
if [ ! -d "$MT_WORLDS_DIR/$MT_MYWORLD_NAME" ]; then
customDie " ERROR: failed to find world path, so cannot continue."
customExit " ERROR: failed to find world path, so cannot continue."
fi
MT_MYWORLD_DIR=$MT_WORLDS_DIR/$MT_MYWORLD_NAME
echo "Using world at $MT_MYWORLD_DIR"
@ -335,7 +335,7 @@ reinstall_mt_game() {
if [ -d "$USR_SHARE_MINETEST/games/minetest_game" ]; then
echo "successfully recreated $USR_SHARE_MINETEST/games/minetest_game"
else
customDie "failed to create $USR_SHARE_MINETEST/games/minetest_game, so cannot continue."
customExit "failed to create $USR_SHARE_MINETEST/games/minetest_game, so cannot continue."
fi
else
echo "ERROR: refusing to reinstall minetest_game since missing sources (not at $HOME/minetest/games/minetest_game nor $HOME/Downloads/minetest/games/minetest_game"
@ -406,21 +406,21 @@ add_mod_from_here()
echo "$MTMOD_DEST_NAME" >> "$MOD_LIST"
MTMOD_DEST_PATH=$MT_MYGAME_MODS_PATH/$MTMOD_DEST_NAME
if [ -z "$MTMOD_DEST_NAME" ]; then
customDie "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_DEST_NAME' (1st param)"
customExit "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_DEST_NAME' (1st param)"
fi
if [ -z "$MTMOD_GOT_NAME" ]; then
customDie "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_GOT_NAME' which is the exact downloaded or unzipped folder name (2nd param)"
customExit "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_GOT_NAME' which is the exact downloaded or unzipped folder name (2nd param)"
fi
if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
if [ ! -d "$MTMOD_GOT_NAME" ]; then
customDie "ERROR: nothing done since add_mod_from_here FAILED to find '$MTMOD_GOT_NAME'"
customExit "ERROR: nothing done since add_mod_from_here FAILED to find '$MTMOD_GOT_NAME'"
fi
if [ -d "$MTMOD_DEST_PATH" ]; then
if [ ! -f "`command -v rsync`" ]; then
echo "removing old $MTMOD_DEST_PATH"
rm -Rf "$MTMOD_DEST_PATH"
if [ -d "$MTMOD_DEST_PATH" ]; then
customDie "FAILED to remove '$MTMOD_DEST_PATH'"
customExit "FAILED to remove '$MTMOD_DEST_PATH'"
fi
fi
fi
@ -436,7 +436,7 @@ if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
mkdir -p "$MTMOD_DEST_PATH"
fi
if [ "$show_changes" != "false" ]; then
#rsync -rtv "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH"
# rsync -rtv "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH"
echo " * preview of changes (before actual sync):"
rsync -zvc "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH" --dry-run | grep -v '\.git' | grep -v '\./' | grep -v 'screenshot\.png' | grep -v received | grep -v 'DRY RUN'
fi
@ -463,7 +463,7 @@ if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
fi
fi
if [ ! -d "$MTMOD_DEST_PATH" ]; then
customDie " ERROR: failed to get $MTMOD_DEST_PATH, so cannot continue."
customExit " MTMOD_DEST_PATH $MTMOD_DEST_PATH is not a directory."
else
echo " [ + ] added as $MTMOD_DEST_PATH"
fi
@ -471,9 +471,9 @@ if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
#if [ -d GitHub/EnlivenMinetest ]; then
# cd GitHub/EnlivenMinetest
#fi
else
else
echo " [ ~ ] skipped existing $MTMOD_DEST_PATH"
fi
fi
}
remove_mod()

Loading…
Cancel
Save