Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RimWorld1.1のままプレイするためにバージョンを固定したMODのなかで、ワークショップで1.1と1.2両対応のバージョンがリリースされたやつだけ固定を解除するスクリプト
#! /bin/fish
# Steam Workshop mods
# ~/.steam/steam/steamapps/workshop/content/294100/
# manual-installed mods
# ~/.steam/steam/steamapps/common/RimWorld/Mods/
for i in ~/.steam/steam/steamapps/workshop/content/294100/*
if [ -f $i/About/About.xml ] && [ -f ~/.steam/steam/steamapps/common/RimWorld/Mods/(basename $i)/About/About.xml ]
#echo $i
set name (cat $i/About/About.xml | xmllint --xpath "//ModMetaData/name/text()" -)
set target_version (cat $i/About/About.xml | xmllint --xpath "//ModMetaData/supportedVersions/li/text()" -)
if contains '1.1' $target_version && contains '1.2' $target_version
echo -n "delete" $name "("$i"): "
echo $target_version
rm -rf ~/.steam/steam/steamapps/common/RimWorld/Mods/(basename $i)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment