Last active
February 2, 2024 23:37
-
-
Save ForeverZer0/f75bc52f5eb0c07f00d66728dfc8e511 to your computer and use it in GitHub Desktop.
Simple helper to download RimWorld mods via the terminal from SteamWorkshop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Downloads a RimWorld mod from a SteamWorkshop URL | |
# | |
# Usage: rimmod URL [URL2 [URL3]]] | |
# Example: rimmod https://steamcommunity.com/sharedfiles/filedetails/?id=2009463077 | |
# | |
# Requires steamcmd to be installed and in $PATH | |
# Mods will be installed in the Steam folder. (i.e. ~/.steam/SteamApps/workshop/content/294100/) | |
function rimmod() { | |
app_id=294100 | |
if [[ $# -eq 0 ]]; then | |
echo "Expected one or more SteamWorkshop URL(s)" | |
exit 1 | |
fi | |
cmds="steamcmd +login anonymous" | |
for arg in "$@"; do | |
mod_id=$(echo "$arg" | grep -oP 'id=\K([0-9]+)') | |
if [ -z "$mod_id" ]; then | |
echo "Failed to parse $arg" | |
exit 1 | |
fi | |
cmds="$cmds +workshop_download_item $app_id $mod_id" | |
done | |
eval "$cmds +quit" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment