Skip to content

Commit

Permalink
ci: fix version thing
Browse files Browse the repository at this point in the history
  • Loading branch information
esauvisky authored Nov 13, 2023
1 parent 0cabbf6 commit 17aae92
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
OLDPWD="$PWD"
DIRNAME=$(dirname "$0")

cd "$DIRNAME"

ver=$(sed -n "s|^versionCode=||p" module.prop)
name=$(sed -n "s|^name=||p" module.prop | sed "s| |-|g")
if [ .$1 == .github ]; then
newVerCode="$ver"
else
newVerCode=$((ver + 1))
fi
newVerCode="$ver"
newVersion=$(echo $newVerCode | \sed 's|\(.\)\(.\)\(.\)|\1\.\2\.\3|')

sed --in-place "s|^versionCode=$ver|versionCode=$newVerCode|;s|^version=v.*|version=v$newVersion|" module.prop
Expand Down

0 comments on commit 17aae92

Please sign in to comment.