Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 146b711a9b | |||
| 5aafd2f16b | |||
| c30d2a46a5 | |||
| b6e92e2918 | |||
| afbb6d3a0c | |||
| f87b2709b0 | |||
| 7666638328 | |||
| 5f7f2a261a | |||
| efe8720507 |
@@ -6,6 +6,13 @@ This script is complete, the version will always [remain at 0.x.x](https://0ver.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
Pre-requisites:
|
||||||
|
|
||||||
|
- You must have the `unzip` package installed for zip archives;
|
||||||
|
- You might want to have the `unarchiver` package installed for rar archives.
|
||||||
|
|
||||||
|
> The `unzip` package comes pre-installed on most Linux distributions. If you do not know how to install packages, search for your Linux distro and package manager.
|
||||||
|
|
||||||
To install Helldivers 2 Mod Manager CLI run the following command in your terminal:
|
To install Helldivers 2 Mod Manager CLI run the following command in your terminal:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -19,7 +26,8 @@ If for some reason, the installation command doesn't work you can:
|
|||||||
|
|
||||||
1. Go to <https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh>
|
1. Go to <https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh>
|
||||||
1. Right click -> Save page as...
|
1. Right click -> Save page as...
|
||||||
1. Go to your downloads folders `cd ~/Downloads`
|
1. Open your terminal
|
||||||
|
1. Go to your downloads folders with `cd ~/Downloads`
|
||||||
1. Give the script execution permissions `chmod +x install.sh`
|
1. Give the script execution permissions `chmod +x install.sh`
|
||||||
1. Run the script `./install.sh`
|
1. Run the script `./install.sh`
|
||||||
|
|
||||||
@@ -33,25 +41,27 @@ h2mm
|
|||||||
|
|
||||||
### Available commands
|
### Available commands
|
||||||
|
|
||||||
- `install` - Install a mod by the file provided (directory, zip, patch).
|
- `install` or `i` - Install a mod by the file provided (directory, zip, patch);
|
||||||
- `uninstall` - Uninstall a mod.
|
- `uninstall` or `u` - Uninstall a mod;
|
||||||
- `list` - List all installed mods.
|
- `list` or `l` - List all installed mods;
|
||||||
- `enable` - Enable a mod.
|
- `enable` or `e` - Enable a mod;
|
||||||
- `disable` - Disable a mod.
|
- `disable` or `d` - Disable a mod;
|
||||||
- `export` - Export installed mods to a zip file.
|
- `order` or `o` - Change load order for a mod;
|
||||||
- `import` - Import mods from a zip file.
|
- `export` or `ex` - Export installed mods to a zip file;
|
||||||
- `order` - Change load order for a mod.
|
- `import` or `im` - Import mods from a zip file;
|
||||||
- `modpack-create` - Create a modpack from the currently installed mods.
|
- `modpack-create` or `mc` - Create a modpack from the currently installed mods;
|
||||||
- `modpack-switch` - Switch to a modpack.
|
- `modpack-switch` or `ms` - Switch to a modpack;
|
||||||
- `modpack-list` - List all installed modpacks.
|
- `modpack-list` or `ml` - List all installed modpacks;
|
||||||
- `modpack-delete` - Delete a modpack.
|
- `modpack-delete` or `md` - Delete a modpack;
|
||||||
- `modpack-overwrite` - Overwrite a modpack.
|
- `modpack-overwrite` or `mo` - Overwrite a modpack;
|
||||||
- `modpack-reset` - Reset all installed modpacks.
|
- `modpack-reset` or `mr` - Reset all installed modpacks;
|
||||||
- `update` - Update h2mm to latest version.
|
- `nexus-setup` or `ns` - Setup Nexus Mods integration;
|
||||||
- `reset` - Reset all installed mods.
|
- `nexus-update` or `nu` - Start Nexus mods upgrade process;
|
||||||
- `help` - Display this help message.
|
- `update` or `up` - Update h2mm to latest version;
|
||||||
|
- `reset` or `r` - Reset all installed mods;
|
||||||
|
- `help` or `h` - Display this help message.
|
||||||
|
|
||||||
### Basic usage
|
### Usage
|
||||||
|
|
||||||
To find out how to use a command, you can run `h2mm <COMMAND> --help`.
|
To find out how to use a command, you can run `h2mm <COMMAND> --help`.
|
||||||
|
|
||||||
@@ -59,17 +69,27 @@ To find out how to use a command, you can run `h2mm <COMMAND> --help`.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
h2mm install /path/to/mod.zip
|
h2mm install /path/to/mod.zip
|
||||||
h2mm install /path/to/mod/files
|
h2mm install /path/to/mod/directory/
|
||||||
h2mm install /path/to/mod.zip /path/to/mod2.zip /path/to/mod/files
|
h2mm install /path/to/mod.zip /path/to/mod2.zip /path/to/mod/files
|
||||||
h2mm install -n "Example mod" mod.patch_0 mod.patch_0.stream # -n is mandatory when using files
|
h2mm install -n "Example mod" mod.patch_0 mod.patch_0.stream # -n is mandatory when using files
|
||||||
h2mm install -n "Example mod" mod* # using a wildcard to include all files
|
```
|
||||||
|
|
||||||
|
> It's better to be in the directory where the mod files are located, so you don't have to specify the full path. For mod downloads, you can do `cd ~/Downloads` and then run the command.
|
||||||
|
>
|
||||||
|
> Also, use the Tab key to autocomplete the file names, as it will help you escape special characters likes spaces or quotes.
|
||||||
|
|
||||||
|
#### List installed mods
|
||||||
|
|
||||||
|
```bash
|
||||||
|
h2mm list
|
||||||
|
h2mm list -v # verbose mode
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Uninstall a mod
|
#### Uninstall a mod
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
h2mm uninstall -n "Example mod"
|
h2mm uninstall -n "Example mod"
|
||||||
h2mm uninstall -i 3
|
h2mm uninstall -i 3 # get the index from the list command
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Enable/disable mods
|
#### Enable/disable mods
|
||||||
@@ -81,18 +101,22 @@ h2mm disable -n "Example mod"
|
|||||||
h2mm disable -i 3
|
h2mm disable -i 3
|
||||||
```
|
```
|
||||||
|
|
||||||
#### List installed mods
|
|
||||||
|
|
||||||
```bash
|
|
||||||
h2mm list
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Updating the script
|
#### Updating the script
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
h2mm update
|
h2mm update
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Nexus Mods integration
|
||||||
|
|
||||||
|
Nexus Mods integration allows you to use the 1-click install feature of Nexus Mods (with the "Vortex" or "Mod manager download" buttons). You can set up Nexus Mods integration by running the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
h2mm nexus-setup
|
||||||
|
```
|
||||||
|
|
||||||
|
You will be walked through the setup process, which will ask you for your Nexus Mods API key and your preferred terminal.
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
The script is developed and tested on Arch Linux, but it should work on other Linux distributions as well. If you encounter any issues, please open an issue on the repository.
|
The script is developed and tested on Arch Linux, but it should work on other Linux distributions as well. If you encounter any issues, please open an issue on the repository.
|
||||||
@@ -103,62 +127,7 @@ Status of platforms:
|
|||||||
- Steam Deck :white_check_mark:
|
- Steam Deck :white_check_mark:
|
||||||
- Windows - WSL :white_check_mark:
|
- Windows - WSL :white_check_mark:
|
||||||
|
|
||||||
> The script works on WSL, but you need to specify the path to the Helldivers 2 mods directory manually, to find your Windows partition head to `/mnt/` and from there go to your Helldivers 2 data directory, on a typical install it should be on `/mnt/c/Program\ Files\ \(x86\)/Steam/steamapps/common/Helldivers\ 2/data`. You also need to have `unzip` installed, which can be done by running `sudo apt install unzip`.
|
> The script works on WSL, but you need to specify the path to the Helldivers 2 mods directory manually, to find your Windows partition head to `/mnt/` and from there go to your Helldivers 2 data directory, on a typical install it should be on `/mnt/c/Program\ Files\ \(x86\)/Steam/steamapps/common/Helldivers\ 2/data`. You also need to have `unzip` installed, which can be done by running `sudo apt install unzip`. Nexus Mods integration is not supported on WSL.
|
||||||
|
|
||||||
## Advanced usage
|
|
||||||
|
|
||||||
### Shortcuts
|
|
||||||
|
|
||||||
You can use the short form of commands to save some time. The shortcuts are:
|
|
||||||
|
|
||||||
- `i` for `install`
|
|
||||||
- `u` for `uninstall`
|
|
||||||
- `e` for `enable`
|
|
||||||
- `d` for `disable`
|
|
||||||
- `l` for `list`
|
|
||||||
- `ex` for `export`
|
|
||||||
- `im` for `import`
|
|
||||||
- `o` for `order`
|
|
||||||
- `mc` for `modpack-create`
|
|
||||||
- `ms` for `modpack-switch`
|
|
||||||
- `ml` for `modpack-list`
|
|
||||||
- `md` for `modpack-delete`
|
|
||||||
- `mo` for `modpack-overwrite`
|
|
||||||
- `mr` for `modpack-reset`
|
|
||||||
- `up` for `update`
|
|
||||||
- `r` for `reset`
|
|
||||||
|
|
||||||
### Modpacks support
|
|
||||||
|
|
||||||
You can set up modpacks by using the `modpack-*` commands. This allows you to quickly change between a set of mods. For more information, check the help message.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
h2mm modpack-create -n "Modpack 1"
|
|
||||||
# install, enable, disable other mods...
|
|
||||||
h2mm modpack-create -n "Modpack 2"
|
|
||||||
h2mm modpack-switch -n "Modpack 1"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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 archive file (`.tar.gz`) will be saved in the current directory.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
h2mm export
|
|
||||||
h2mm import /path/to/mods.tar.gz
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
```
|
|
||||||
|
|
||||||
### Database location and details
|
|
||||||
|
|
||||||
The database is stored in the `Helldivers 2` install directory, under the `data` folder with the name `mods.csv`, where the mods are also installed. The database is a simple CSV file which you can use to manually manage mods if needed, you can mostly use it to rename or reorder mods.
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
+22
-7
@@ -44,7 +44,8 @@ EOF
|
|||||||
breaking_changes_patches=(
|
breaking_changes_patches=(
|
||||||
["2"]='sed -i "s/^\([0-9]\+\),/\1,ENABLED,/" "$1/mods.csv"'
|
["2"]='sed -i "s/^\([0-9]\+\),/\1,ENABLED,/" "$1/mods.csv"'
|
||||||
["3"]='sed -i "1 i\\3" "$1/mods.csv"'
|
["3"]='sed -i "1 i\\3" "$1/mods.csv"'
|
||||||
["4"]='awk '\''BEGIN {FS=OFS=","} NR==1 {print 4; next} {print NR-1, $2, $3, $4, $5}'\'' "$1/mods.csv" | tee "$1/mods.csv" > /dev/null'
|
["4"]='tmp_file=$(mktemp) && awk '\''BEGIN {FS=OFS=","} NR==1 {print 4; next} {print NR-1, $2, $3, $4, $5}'\'' "$1/mods.csv" > "$tmp_file" && tee "$1/mods.csv" < "$tmp_file" > /dev/null && rm "$tmp_file"'
|
||||||
|
["5"]='sed -i "s/^\([0-9]\+\),\(.*\),\(.*\),\(.*\)/\1,\2,\3,,,,\4/" "$1/mods.csv"; sed -i "1 s/4/5/" "$1/mods.csv"'
|
||||||
)
|
)
|
||||||
|
|
||||||
# notify if update is happening
|
# notify if update is happening
|
||||||
@@ -82,14 +83,17 @@ if [[ "$response_sd" == "y" || "$response_sd" == "Y" ]]; then
|
|||||||
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
|
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
|
||||||
# add ~/.local/bin to PATH
|
# add ~/.local/bin to PATH
|
||||||
log INFO "Installing the script on a Steam Deck means adding $DESTINATION_PATH to your \$PATH."
|
log INFO "Installing the script on a Steam Deck means adding $DESTINATION_PATH to your \$PATH."
|
||||||
log INFO "If you're using a different shell than bash, you may need to add it manually."
|
log INFO "If you're using a different shell than bash (the default), you may need to add it manually."
|
||||||
|
|
||||||
log PROMPT "Do you want to add $DESTINATION_PATH to your \$PATH in ~/.bashrc? (Y/n): "
|
log PROMPT "Do you want to add $DESTINATION_PATH to your \$PATH in ~/.bashrc? (Y/n): "
|
||||||
IFS= read -e response
|
IFS= read -e response
|
||||||
if [[ "$response" == "y" || "$response" = "Y" || -z "$response" ]]; then
|
if [[ "$response" == "y" || "$response" = "Y" || -z "$response" ]]; then
|
||||||
echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> "$HOME/.bashrc"
|
echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> "$HOME/.bashrc"
|
||||||
|
|
||||||
[[ $? -ne 0 ]] && { log ERROR "Failed to add $DESTINATION_PATH to \$PATH in ~/.bashrc." ; exit 1; }
|
[[ $? -ne 0 ]] && { log ERROR "Failed to add $DESTINATION_PATH to \$PATH in ~/.bashrc." ; exit 1; }
|
||||||
|
|
||||||
|
source "$HOME/.bashrc"
|
||||||
|
[[ $? -ne 0 ]] && { log ERROR "Failed to source ~/.bashrc." ; exit 1; }
|
||||||
|
|
||||||
log INFO "Added $DESTINATION_PATH to your \$PATH in ~/.bashrc."
|
log INFO "Added $DESTINATION_PATH to your \$PATH in ~/.bashrc."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -119,6 +123,10 @@ if [[ $latest_major -gt $installed_major ]]; then
|
|||||||
search_dir="${HOME}"
|
search_dir="${HOME}"
|
||||||
target_dir="Steam/steamapps/common/Helldivers\ 2/data"
|
target_dir="Steam/steamapps/common/Helldivers\ 2/data"
|
||||||
|
|
||||||
|
# make backup
|
||||||
|
log INFO "Creating a backup in case anything goes wrong."
|
||||||
|
h2mm export
|
||||||
|
|
||||||
# check if game directory is in ~/.config/h2mm/h2path
|
# check if game directory is in ~/.config/h2mm/h2path
|
||||||
if [[ -f "$HOME/.config/h2mm/h2path" ]]; then
|
if [[ -f "$HOME/.config/h2mm/h2path" ]]; then
|
||||||
game_dir=$(cat "$HOME/.config/h2mm/h2path")
|
game_dir=$(cat "$HOME/.config/h2mm/h2path")
|
||||||
@@ -126,8 +134,8 @@ if [[ $latest_major -gt $installed_major ]]; then
|
|||||||
|
|
||||||
log INFO "Helldivers 2 data directory found: $game_dir."
|
log INFO "Helldivers 2 data directory found: $game_dir."
|
||||||
else
|
else
|
||||||
log INFO "Searching for the Helldivers 2 data directory... (20 seconds timeout)"
|
log INFO "Searching for the Helldivers 2 data directory... (10 seconds timeout)"
|
||||||
game_dir=$(timeout 20 find "$search_dir" -type d -path "*/$target_dir" 2>/dev/null | head -n 1)
|
game_dir=$(timeout 10 find "$search_dir" -type d -path "*/$target_dir" 2>/dev/null | head -n 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if not found, prompt user
|
# if not found, prompt user
|
||||||
@@ -172,5 +180,12 @@ sudo chmod +x "$DESTINATION_PATH/$SCRIPT_NAME"
|
|||||||
log INFO ""
|
log INFO ""
|
||||||
|
|
||||||
[[ ! -x "$(command -v $SCRIPT_NAME)" ]] && { log ERROR "Installation failed. Mod manager was not found in \$PATH." ; exit 1; }
|
[[ ! -x "$(command -v $SCRIPT_NAME)" ]] && { log ERROR "Installation failed. Mod manager was not found in \$PATH." ; exit 1; }
|
||||||
log INFO "Helldivers 2 Mod Manager CLI ${GREEN}successfully${NC} installed: $DESTINATION_PATH/$SCRIPT_NAME."
|
|
||||||
log INFO "Use it by running '$SCRIPT_NAME'. Made with love <3 by v4n and contributors."
|
log INFO "Helldivers 2 Mod Manager CLI ${GREEN}successfully${NC} installed."
|
||||||
|
log INFO "${GREEN}IMPORTANT${NC}: To install mods, you need to have installed:"
|
||||||
|
log INFO " -> \"unzip\" package for .zip archives"
|
||||||
|
log INFO " -> \"unarchiver\" package for .rar archives"
|
||||||
|
log INFO "If you do not know how to install these packages, please search for your linux distro on how to install packages."
|
||||||
|
log INFO ""
|
||||||
|
log INFO "Use the mod manager by running '$SCRIPT_NAME' in your terminal."
|
||||||
|
log INFO "Made with love <3 by v4n and contributors."
|
||||||
|
|||||||
Reference in New Issue
Block a user