From af55a2d41435850d592571190be6192f3189aaf6 Mon Sep 17 00:00:00 2001 From: v4n <105587619+v4n00@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:17:32 +0200 Subject: [PATCH] fix: line end to LF --- README.md | 19 +++++++++++++------ h2mm | 4 ++-- install.sh | 42 +++++++++++++++++++++--------------------- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5b6a526..cf5e800 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,20 @@ - [Database location and details](#database-location-and-details) - [Contributing](#contributing) - Helldivers 2 Mod Manager CLI is a command line interface for managing Helldivers 2 mods. Since there is no mod manager GUI for Helldivers 2 on Linux yet, this small script aims to provide a simple way to manage mods on Linux. ## Installation To install/update Helldivers 2 Mod Manager CLI run the following command in your terminal: + ```bash -bash -c "$(curl -fsSL https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh)" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh)" ``` ## Usage The script gets added to `/usr/local/bin/h2mm` and can be used by running `h2mm` in your shell, which will show the help message explaining how to use the script. + ```bash h2mm ``` @@ -37,14 +38,15 @@ h2mm - `install` - Install a mod with files - `uninstall` - Uninstall a mod by name - `list` - List all installed mods -- `export ` - Export installed mods to a zip file -- `import ` - Import mods from a zip file -- `reset` - Reset all installed mods +- `export ` - Export installed mods to a zip file +- `import ` - Import mods from a zip file +- `reset` - Reset all installed mods - `help` - Display the help message ### Basic usage #### Install a mod + ```bash h2mm install /path/to/mod.zip h2mm install /path/to/mod/files @@ -53,12 +55,14 @@ h2mm install -n "Example mod" mod* # using a wildcard to include all files ``` #### Uninstall a mod + ```bash h2mm uninstall "Example mod" h2mm uninstall -i 1 # uninstall mod with index 1 ``` #### List installed mods + ```bash h2mm list ``` @@ -68,6 +72,7 @@ h2mm list ### Shortcuts You can use the short form of the commands to save some time. The shortcuts are: + - `i` for `install` - `u` for `uninstall` - `l` for `list` @@ -78,6 +83,7 @@ You can use the short form of the commands to save some time. The shortcuts are: ### Exporting and importing You can export all installed mods to a zip file and import mods from the same file. This can be useful for sharing mods with others or for backing up your mods. The zip file will be saved in the current directory. + ```bash h2mm export mods.zip h2mm import mods.zip @@ -86,6 +92,7 @@ h2mm import mods.zip ### Resetting all installed mods You can reset all installed mods by running the following command. This will remove all installed mods and the database, in case things go wild. + ```bash h2mm reset ``` @@ -96,4 +103,4 @@ The database is stored in the `Helldivers 2` install directory, under the `data` ## Contributing -Feel free to contribute to this project by creating a pull request or opening an issue. \ No newline at end of file +Feel free to contribute to this project by creating a pull request or opening an issue. diff --git a/h2mm b/h2mm index 7de8826..29ee302 100755 --- a/h2mm +++ b/h2mm @@ -1,5 +1,5 @@ #!/bin/bash -# Helldivers 2 Mod Manager +# Helldivers 2 Mod Manager v0.1.0 # --- Globals --- @@ -85,7 +85,7 @@ function initialize_directories() { # --- Help Functions --- function display_help() { - echo "Helldivers 2 Mod Manager" + echo "Helldivers 2 Mod Manager v0.1.0" echo "Usage: h2mm [command] [options]" echo "Commands:" echo " install Install a mod with files (short form: h2mm i)." diff --git a/install.sh b/install.sh index 486f4db..f6d32e5 100755 --- a/install.sh +++ b/install.sh @@ -1,21 +1,21 @@ -#!/bin/bash -set -e - -if [ "$(id -u)" -eq 0 ]; then - echo "Run me as normal user, not as root." - exit 1 -fi - -DESTINATION_PATH="/usr/local/bin" -SCRIPT_NAME="h2mm" - -echo "Installing $SCRIPT_NAME..." -sudo curl https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/h2mm --output "$DESTINATION_PATH/$SCRIPT_NAME" -sudo chmod +x "$DESTINATION_PATH/$SCRIPT_NAME" - -if [[ ! -x "$(command -v $SCRIPT_NAME)" ]]; then - echo "Installation failed." - exit 1 -fi - -echo "Helldivers 2 Mod Manager CLI installed successfully to $DESTINATION_PATH/$SCRIPT_NAME. Use it by running '$SCRIPT_NAME'." +#!/bin/bash +set -e + +if [ "$(id -u)" -eq 0 ]; then + echo "Run me as normal user, not as root." + exit 1 +fi + +DESTINATION_PATH="/usr/local/bin" +SCRIPT_NAME="h2mm" + +echo "Installing $SCRIPT_NAME..." +sudo curl https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/h2mm --output "$DESTINATION_PATH/$SCRIPT_NAME" +sudo chmod +x "$DESTINATION_PATH/$SCRIPT_NAME" + +if [[ ! -x "$(command -v $SCRIPT_NAME)" ]]; then + echo "Installation failed." + exit 1 +fi + +echo "Helldivers 2 Mod Manager CLI installed successfully to $DESTINATION_PATH/$SCRIPT_NAME. Use it by running '$SCRIPT_NAME'." \ No newline at end of file