update_doom_mods.sh 819 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. game_dir=~/games/doom
  3. downloadLatestFromGithub() {
  4. download_directory=$1
  5. github_repo=$2
  6. ext=$3
  7. cd || return
  8. mod_dir=${game_dir}/${download_directory}
  9. mkdir -p "$mod_dir"
  10. cd "$mod_dir" || return
  11. curl -O -L "$(curl -s https://api.github.com/repos/${github_repo}/releases/latest | jq -r ".assets[] | select(.name | test(\"${ext}\")) | .browser_download_url")"
  12. }
  13. downloadLatestFromGithub "mods/zdoom/beautiful_doom" "jekyllgrim/Beautiful-Doom" ".pk3"
  14. downloadLatestFromGithub "mods/zdoom/brutal/brutal_doom/" "BLOODWOLF333/Brutal-Doom-Community-Expansion" ".pk3"
  15. downloadLatestFromGithub "mods/zdoom/immerse/" "JRHard771/Immerse" ".pk3"
  16. downloadLatestFromGithub "mods/zdoom/droplets/" "JRHard771/droplets" ".pk3"
  17. downloadLatestFromGithub "mods/zdoom/darkdoomz/" "caligari87/darkdoomz" ".pk3"