Skip to content

Commit

Permalink
dev: set default version if undefined
Browse files Browse the repository at this point in the history
fixes #10
  • Loading branch information
jasperalani authored Jan 24, 2024
1 parent ac333c4 commit c3ca8f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions update_version.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash

# Replace the version in build.gradle and mods.toml with the first argument
# usage: ./update_version.sh 1.2

unformattedVersion=$(awk -v FS="version = " 'NF>1{print $2}' build.gradle)

unformattedVersion="${unformattedVersion:1}"
version="${unformattedVersion::-14}"

#minor="${version: -1}"
#minorRemoved="${version::-1}"
#minorIncreased="$(($minor + 1))"
#newVersion="$minorRemoved$minorIncreased"
newVersion=$1

if [ $newVersion == "" ]
then
newVersion="1.0.0"
fi

if [ $newVersion != "" ]
then
# Replace in build.gradle
Expand Down

0 comments on commit c3ca8f1

Please sign in to comment.