diff --git a/web/bin/dz b/web/bin/dz index 9816775..aa8eb34 100755 --- a/web/bin/dz +++ b/web/bin/dz @@ -123,6 +123,7 @@ add(){ echo -e "Mod id ${1} - ${green}${MODNAME}${default} - added" xml ${ID} map ${ID} + installMod ${ID} } # Remove a mod @@ -146,6 +147,17 @@ remove(){ echo -e "Mod id ${1} - ${red}${MODNAME}${default} - removed" } +# Handle custom scripts after installing a mod +installMod(){ + FILE="${WORKSHOP_DIR}/${1:?}/install.sh" + if [ -f "${FILE}" ] + then + MODNAME=$(get_mod_name ${1}) + echo "Running custom install script ${FILE} for mod id ${1}" + ${FILE} + fi +} + # Handle the Steam login information. login(){ if [ -f "${STEAM_LOGIN}" ] @@ -324,14 +336,14 @@ Mods: " map(){ # Install map mpmissions for mods that have them. Presumes a map.env was created for the mod, with the required metadata (git URL, etc.) - TERM="map" - if [[ "${1}" =~ ^[0-9]+$ ]] - then - TERM="mod id" - fi + WHICH="map" + if [[ "${1}" =~ ^[0-9]+$ ]] + then + WHICH="mod id" + fi if [ -f "${FILES}/mods/${1}/map.env" ] then - echo "Installing mpmissions files for ${TERM} ${1}..." + echo "Installing mpmissions files for ${WHICH} ${1}..." source ${FILES}/mods/${1}/map.env ${FILES}/bin/map.sh ${1} install fi