summaryrefslogtreecommitdiff
path: root/build/set-smapi-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/set-smapi-version.sh')
-rwxr-xr-xbuild/set-smapi-version.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/set-smapi-version.sh b/build/set-smapi-version.sh
new file mode 100755
index 00000000..42174cae
--- /dev/null
+++ b/build/set-smapi-version.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# get version number
+version="$1"
+if [ $# -eq 0 ]; then
+ echo "SMAPI release version (like '4.0.0'):"
+ read version
+fi
+
+# move to SMAPI root
+cd "`dirname "$0"`/.."
+
+# apply changes
+sed "s/<Version>.+<\/Version>/<Version>$version<\/Version>/" "build/common.targets" --in-place --regexp-extended
+sed "s/RawApiVersion = \".+?\";/RawApiVersion = \"$version\";/" "src/SMAPI/Constants.cs" --in-place --regexp-extended
+for modName in "ConsoleCommands" "ErrorHandler" "SaveBackup"; do
+ sed "s/\"(Version|MinimumApiVersion)\": \".+?\"/\"\1\": \"$version\"/g" "src/SMAPI.Mods.$modName/manifest.json" --in-place --regexp-extended
+done