diff options
author | Joe Previte | 2022-08-16 20:28:05 +0000 |
---|---|---|
committer | Joe Previte | 2022-08-16 20:28:05 +0000 |
commit | 306f11409a854f60393a71b69982c5be72cc0742 (patch) | |
tree | 1c1cae132593ed636ab09200c337243562da49c0 /update.sh | |
parent | c42314723bdef9ce3fcd016dab9218b7e571eba7 (diff) | |
download | aur-306f11409a854f60393a71b69982c5be72cc0742.tar.gz |
refactor: take arg in update.sh
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/update.sh b/update.sh index 403055296e29..8d3a64c764db 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Description: This is a script to update the version -# Run it with `sh update.sh` and it will do the following: +# Run it with `sh update.sh <version>` and it will do the following: # 1. Update the `pkgver` in `PKGBUILD` to the latest version # 2. Run `updpkgsums` to update the sha256 sums # - If you don't have it installed, run `sudo pacman -S pacman-contrib` @@ -10,7 +10,6 @@ # makepkg --printsrcinfo > .SRCINFO # ``` # 4. Push changes to GitHub: `git push` -# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep set -euo pipefail @@ -26,11 +25,15 @@ main() { ls grep "pkgver=" PKGBUILD CODE_SERVER_CURRENT_VERSION=$(grep "pkgver=" PKGBUILD | cut -d "=" -f2-) - # Ask which version we should update to - # In the future, we'll automate this and determine the latest version automatically echo "Current version: ${CODE_SERVER_CURRENT_VERSION}" - read -r -p "What version of code-server do you want to update to?"$'\n' CODE_SERVER_VERSION_TO_UPDATE + CODE_SERVER_VERSION_TO_UPDATE=${1:-""} + + if [ "$CODE_SERVER_VERSION_TO_UPDATE" == "" ]; then + echo "Please call this script with the version to update to." + echo "i.e. 4.5.2" + exit 1 + fi echo -e "Great! We'll update to $CODE_SERVER_VERSION_TO_UPDATE\n" |