We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 650c88c commit 7705a05Copy full SHA for 7705a05
install.sh
@@ -201,6 +201,10 @@ main() {
201
exit 1
202
fi
203
204
+ if ! should_update; then
205
+ return 0
206
+ fi
207
+
208
distro_name
209
210
ARCH="$(arch)"
@@ -489,6 +493,21 @@ arch() {
489
493
esac
490
494
}
491
495
496
+should_update() {
497
+ if ! command_exists code-server; then
498
499
500
501
+ installed_version="$(code-server --version | cut -d " " -f1)"
502
+ if [ "$installed_version" != "$VERSION" ]; then
503
+ echo "updating as installed version v$installed_version does not match version v$VERSION"
504
505
506
507
+ echo "already on version v$VERSION"
508
+ return 1
509
+}
510
492
511
command_exists() {
512
command -v "$@" > /dev/null
513
0 commit comments