fix: small fixes
This commit is contained in:
+4
-3
@@ -1,3 +1,4 @@
|
|||||||
h2path
|
*
|
||||||
*.patch*
|
!h2mm
|
||||||
*test*
|
!install.sh
|
||||||
|
!README.md
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
# TODO:
|
# TODO:
|
||||||
# export mods
|
# export mods
|
||||||
# import mods
|
# import mods
|
||||||
|
# reset all
|
||||||
|
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
@@ -49,8 +50,7 @@ function find_game_directory() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$game_dir" > "$H2PATH"
|
echo "$game_dir" > "$H2PATH"
|
||||||
echo -e "Game directory ${GREEN}saved{$NC} to: $H2PATH" >&2
|
echo -e "Game directory ${GREEN}saved${NC}: $game_dir" >&2
|
||||||
echo "--- /// ---" >&2
|
|
||||||
echo "$game_dir"
|
echo "$game_dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,47 +63,51 @@ function initialize_directories() {
|
|||||||
echo "Database file created at: $DB_FILE"
|
echo "Database file created at: $DB_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--- /// MODS /// ---" >&2
|
echo "--- /// MAIN /// ---" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_help() {
|
function display_help() {
|
||||||
echo "Helldivers 2 Mod Manager"
|
echo "Helldivers 2 Mod Manager"
|
||||||
echo "Usage: h2mm [command] [options]"
|
echo "Usage: h2mm [command] [options]"
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
echo " install -n \"<mod_name>\" <mod_files> Install a mod with a name and files."
|
echo " install -n \"<mod_name>\" <mod_files> Install a mod with a name and files."
|
||||||
echo " list List all installed mods."
|
echo " uninstall -n \"<mod_name>\" Uninstall a mod by name."
|
||||||
echo " uninstall -n \"<mod_name>\" Uninstall a mod by name."
|
echo " list List all installed mods."
|
||||||
echo " export \"<zip_name>\" Export installed mods to a zip file (not yet implemented)."
|
echo " export \"<zip_name>\" Export installed mods to a zip file (not yet implemented)."
|
||||||
echo " import \"<zip_name>\" Import mods from a zip file (not yet implemented)."
|
echo " import \"<zip_name>\" Import mods from a zip file (not yet implemented)."
|
||||||
echo " help Display this help message."
|
echo " reset Reset all installed mods (not yet implemented)."
|
||||||
echo "For more information, use h2mm [command] --help, available for install and uninstall."
|
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 "Basic Usage:"
|
||||||
echo " h2mm install -n \"Example mod\" a5f2c029522e6714.patch_0 a5f2c029522e6714.patch_0.stream"
|
echo " h2mm install -n \"Example mod\" a5f2c029522e6714.patch_0 a5f2c029522e6714.patch_0.stream"
|
||||||
echo " h2mm uninstall -n \"Example mod\""
|
echo " h2mm uninstall -n \"Example mod\""
|
||||||
|
echo "Advanced Usage:"
|
||||||
|
echo " Database of mods is stored in Steam/steamapps/common/Helldivers\ 2/data/mods.csv"
|
||||||
|
echo " You can rename, delete, or edit this file to manage mods manually."
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_install_help() {
|
function display_install_help() {
|
||||||
echo "Usage: h2mm install -n \"<mod_name>\" [options] <mod_files>"
|
echo "Usage: h2mm install -n \"<mod_name>\" [options] <mod_files>"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -n \"<mod_name>\" Name of the mod (MANDATORY), inside double quotes."
|
echo " -n \"<mod_name>\" Name of the mod (MANDATORY), inside double quotes."
|
||||||
echo " -d <mod_dir> Directory containing mod files."
|
echo " -d <mod_dir> Directory containing mod files."
|
||||||
echo " -z <mod_zip> Zip file containing mod files (.zip only)."
|
echo " -z <mod_zip> Zip file containing mod files (.zip only)."
|
||||||
echo " <mod_files> List of mod files to install."
|
echo " <mod_files> List of mod files to install."
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " h2mm install -n \"Example mod\" a5f2c029522e6714.patch_0 a5f2c029522e6714.patch_0.stream"
|
echo " h2mm install -n \"Example mod\" a5f2c029522e6714.patch_0 a5f2c029522e6714.patch_0.stream"
|
||||||
echo " h2mm install -n \"Example mod\" a5f* (using a wildcard to include all files)"
|
echo " h2mm install -n \"Example mod\" a5f* (using a wildcard to include all files)"
|
||||||
echo " h2mm install -n \"Example mod\" -d /path/to/mod/files"
|
echo " h2mm install -n \"Example mod\" -d /path/to/mod/files"
|
||||||
echo " h2mm install -n \"Example mod\" -z /path/to/mod.zip"
|
echo " h2mm install -n \"Example mod\" -z /path/to/mod.zip"
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_uninstall_help() {
|
function display_uninstall_help() {
|
||||||
echo "Usage: h2mm uninstall [options]"
|
echo "Usage: h2mm uninstall [options]"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -n \"<mod_name>\" Name of the mod to uninstall."
|
echo " -n \"<mod_name>\" Name of the mod to uninstall."
|
||||||
echo " -i <index> Index of the mod to uninstall."
|
echo " -i <index> Index of the mod to uninstall."
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " h2mm uninstall -n \"Example mod\""
|
echo " h2mm uninstall -n \"Example mod\""
|
||||||
echo " h2mm uninstall -i 1"
|
echo " h2mm uninstall -i 1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_mod() {
|
function install_mod() {
|
||||||
@@ -111,6 +115,11 @@ function install_mod() {
|
|||||||
local mod_files=()
|
local mod_files=()
|
||||||
local mod_dir=""
|
local mod_dir=""
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
display_install_help
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# parse arguments
|
# parse arguments
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -205,6 +214,11 @@ function uninstall_mod() {
|
|||||||
local mod_name=""
|
local mod_name=""
|
||||||
local mod_index=""
|
local mod_index=""
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
display_uninstall_help
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# parse arguments
|
# parse arguments
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -310,6 +324,12 @@ case "$command" in
|
|||||||
uninstall_mod "$@"
|
uninstall_mod "$@"
|
||||||
echo "--- /// END /// ---"
|
echo "--- /// END /// ---"
|
||||||
;;
|
;;
|
||||||
|
export)
|
||||||
|
echo "Exporting mods to a zip file is not yet implemented."
|
||||||
|
;;
|
||||||
|
import)
|
||||||
|
echo "Importing mods from a zip file is not yet implemented."
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
display_help
|
display_help
|
||||||
;;
|
;;
|
||||||
|
|||||||
+1
-1
@@ -18,4 +18,4 @@ if [[ ! -x "$(command -v $SCRIPT_NAME)" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Helldivers 2 Mod Manager CLI installed successfully to $DESTINATION_PATH/$SCRIPT_NAME."
|
echo "Helldivers 2 Mod Manager CLI installed successfully to $DESTINATION_PATH/$SCRIPT_NAME. Use it by running '$SCRIPT_NAME'."
|
||||||
|
|||||||
Reference in New Issue
Block a user