summaryrefslogtreecommitdiff
path: root/build/unix/set-smapi-version.sh
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
commit8a2618d812e4e2f36161907af5af5c484eb37abf (patch)
treec164325cf57fb43e4375e94dc584fbc3ab3ceeb5 /build/unix/set-smapi-version.sh
parent42e878e77d58569be81e34ca206a78e0ebe0604d (diff)
parent5b5dd47c22a1332a4c432d6a1cd414b5c83388d7 (diff)
downloadSMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.gz
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.bz2
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.zip
Merge branch 'develop' into stable
Diffstat (limited to 'build/unix/set-smapi-version.sh')
-rw-r--r--build/unix/set-smapi-version.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/build/unix/set-smapi-version.sh b/build/unix/set-smapi-version.sh
new file mode 100644
index 00000000..0c0cbeb0
--- /dev/null
+++ b/build/unix/set-smapi-version.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+#
+#
+# This is the Bash equivalent of ../windows/set-smapi-version.ps1.
+# When making changes, both scripts should be updated.
+#
+#
+
+
+# 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