summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-03 02:16:27 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-03 02:16:27 -0500
commite4416925f9b4d1deac521c62918d008076ac6b05 (patch)
treeb882f3225a6ad05b995bca373513fce107e6b8ce /build
parent181508084b5bb2bb7b8cd61ec3193a293300ba45 (diff)
downloadSMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.tar.gz
SMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.tar.bz2
SMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.zip
add build script to set the release version
Diffstat (limited to 'build')
-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