diff --git a/h2mm b/h2mm index c0e42d7..a2d884e 100755 --- a/h2mm +++ b/h2mm @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="0.2.0" +VERSION="0.2.1" # --- Globals --- @@ -115,17 +115,19 @@ function display_help() { echo "Helldivers 2 Mod Manager v${VERSION}" echo "Usage: h2mm [command] [options]" echo "Commands:" - echo " install Install a mod with files (short form: h2mm i)." - echo " uninstall Uninstall a mod by name (short form: h2mm u)." - echo " list List all installed mods (short form: h2mm l)." - echo " export Export installed mods to a zip file (short form: h2mm ex)." - echo " import Import mods from a zip file (short form: h2mm im)." - echo " reset Reset all installed mods (short form: h2mm rr)." - echo " help Display this help message (short form: h2mm h)." + echo " install Install a mod with files." + echo " uninstall Uninstall a mod by name." + echo " list List all installed mods." + echo " enable Enable a mod by name." + echo " disable Disable a mod by name." + echo " export Export installed mods to a zip file." + echo " import Import mods from a zip file." + echo " reset Reset all installed mods." + echo " help Display this help message." echo "For more information on usage, use h2mm [command] --help, available for install and uninstall." echo "Basic Usage:" - echo " h2mm install -z /path/to/mod.zip" - echo " h2mm install -d /path/to/mod/files" + echo " h2mm install /path/to/mod.zip" + echo " h2mm install /path/to/mod/files" echo " h2mm uninstall \"Example mod\"" } @@ -568,7 +570,7 @@ function mod_list() { echo "Installed mods:" >&2 awk -v GREEN="$GREEN" -v RED="$RED" -v NC="$NC" -F, '{ color = ($2 == "DISABLED") ? RED : GREEN; - if (length($3) > 150) $3 = substr($3, 1, 147) "..."; + if (length($4) > 150) $4 = substr($4, 1, 147) "..."; printf "%2s. [%s%s%s] %s (%s)\n", $1, color, $2, NC, $3, $4}' "$DB_FILE" } diff --git a/install.sh b/install.sh index f098826..bdf2e41 100755 --- a/install.sh +++ b/install.sh @@ -75,10 +75,14 @@ if [[ -x "$(command -v $SCRIPT_NAME)" ]]; then fi [[ ! -f "$game_dir/mods.csv" ]] && { echo -e "${RED}Error:${NC} mods.csv not found in $game_dir."; exit 1; } + + # make backup of mods in case something goes wrong + echo "Creating a backup of mods.csv." + h2mm export # iterate from installed major number to latest major number for ((i = installed_major + 1; i <= latest_major; i++)); do - echo -e "${RED}[ ]${NC} Applying breaking changes patch for version $i." + echo -e "Applying breaking changes patch for version $i." [[ -n "${breaking_changes_patches[$i]}" ]] && eval $(echo "${breaking_changes_patches[$i]}" | sed "s:\$1:$game_dir:") if [[ $? -ne 0 ]]; then @@ -87,10 +91,11 @@ if [[ -x "$(command -v $SCRIPT_NAME)" ]]; then [[ "$response" != "y" && "$response" != "Y" && -n "$response" ]] && { echo "Exiting. Uninstall the script first the retry the install script."; exit 1; } else - echo -e "${GREEN}[X]${NC} Breaking changes patch for version $i applied successfully." + echo -e "Breaking changes patch for version $i applied ${GREEN}successfully${NC}." fi done fi + echo fi # Install diff --git a/version b/version index 341cf11..7dff5b8 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.2.0 \ No newline at end of file +0.2.1 \ No newline at end of file