]> git.armaanb.net Git - lightcards.git/commitdiff
Add version-switch script
authorArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 18:33:26 +0000 (13:33 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 18:33:26 +0000 (13:33 -0500)
contrib/version-switch [new file with mode: 0755]

diff --git a/contrib/version-switch b/contrib/version-switch
new file mode 100755 (executable)
index 0000000..4b143c9
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+current=$(git tag | tail -n 1 | tail -c +2)
+grep -rl --exclude-dir=.git ${current} | \
+  while read line; do
+    sed -i "s/${current}/${1}/g" ${line}
+  done