Skip to content

Commit b50e1bb

Browse files
authored
Merge pull request #11 from coder/update-script
refactor: take arg in update.sh
2 parents c423147 + 306f114 commit b50e1bb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

update.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# Description: This is a script to update the version
3-
# Run it with `sh update.sh` and it will do the following:
3+
# Run it with `sh update.sh <version>` and it will do the following:
44
# 1. Update the `pkgver` in `PKGBUILD` to the latest version
55
# 2. Run `updpkgsums` to update the sha256 sums
66
# - If you don't have it installed, run `sudo pacman -S pacman-contrib`
@@ -10,7 +10,6 @@
1010
# makepkg --printsrcinfo > .SRCINFO
1111
# ```
1212
# 4. Push changes to GitHub: `git push`
13-
# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep
1413

1514
set -euo pipefail
1615

@@ -26,11 +25,15 @@ main() {
2625
ls
2726
grep "pkgver=" PKGBUILD
2827
CODE_SERVER_CURRENT_VERSION=$(grep "pkgver=" PKGBUILD | cut -d "=" -f2-)
29-
# Ask which version we should update to
30-
# In the future, we'll automate this and determine the latest version automatically
3128
echo "Current version: ${CODE_SERVER_CURRENT_VERSION}"
3229

33-
read -r -p "What version of code-server do you want to update to?"$'\n' CODE_SERVER_VERSION_TO_UPDATE
30+
CODE_SERVER_VERSION_TO_UPDATE=${1:-""}
31+
32+
if [ "$CODE_SERVER_VERSION_TO_UPDATE" == "" ]; then
33+
echo "Please call this script with the version to update to."
34+
echo "i.e. 4.5.2"
35+
exit 1
36+
fi
3437

3538
echo -e "Great! We'll update to $CODE_SERVER_VERSION_TO_UPDATE\n"
3639

0 commit comments

Comments
 (0)