diff --git a/README.md b/README.md index aa2a8aa..6b6e411 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,9 @@ To update the version follow these steps. Replace all instances of `[year].[majo ### Automatically do steps 2 to 12 -Run `./update-new-version.sh 2017.3 [year].[major].[minor]` +Run `./update-new-version.sh "$new-version"` + +Where `$new-version` is in the format `[year].[major].[minor]`. ### Setting up the build environment diff --git a/update-new-version.sh b/update-new-version.sh index 43ef9d3..05a7b6d 100755 --- a/update-new-version.sh +++ b/update-new-version.sh @@ -6,8 +6,9 @@ PACKAGE="intellij-idea-community" DISTRIBUTION="disco" main() { - old="$1" - new="$2" + last_tag=$(git describe --tags) + old="${last_tag#?}" + new="$1" name="$(git config --get user.name)" email="$(git config --get user.email)" @@ -36,4 +37,4 @@ main() { # sudo dpkg -i "$PACKAGE"_"$new"-1_all.deb } -main "$1" "$2" +main "$1"