feat: added install script

This commit is contained in:
v4n
2025-01-14 16:25:43 +02:00
parent ecd31b6eac
commit 33403a69f1
3 changed files with 31 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
# h2mm-cli
install
```bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh)"
```
+3 -3
View File
@@ -73,10 +73,10 @@ function display_help() {
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 " 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 " export \"<zip_name>\" Export installed mods to a zip file." echo " export \"<zip_name>\" Export installed mods to a zip file (not yet implemented)."
echo " import \"<zip_name>\" Import mods from a zip file." echo " import \"<zip_name>\" Import mods from a zip file (not yet implemented)."
echo " help Display this help message." echo " help Display this help message."
echo "For more information, use h2mm [command] --help" echo "For more information, 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\""
Executable
+21
View File
@@ -0,0 +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."