Skip to content

Commit 746f55a

Browse files
committed
updated arg --edge parsing to match the style of --dryrun
1 parent 385be36 commit 746f55a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

install.sh

+4-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Usage:
3232
--version X.X.X
3333
Install a specific version instead of the latest.
3434
35-
--edge [true | false (default) ]
35+
--edge
3636
Install the latest edge version instead of the latest stable version.
3737
3838
--method [detect | standalone]
@@ -74,7 +74,7 @@ EOF
7474
}
7575

7676
echo_latest_version() {
77-
if [ "${EDGE:-false}" = "true" ]; then
77+
if [ "${EDGE-}" ]; then
7878
version="$(curl -fsSL https://api.github.com/repos/cdr/code-server/releases | awk 'match($0,/.*"html_url": "(.*\/releases\/tag\/.*)".*/)' | head -n 1 | awk -F '"' '{print $4}')"
7979
else
8080
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
@@ -142,6 +142,7 @@ main() {
142142
OPTIONAL \
143143
ALL_FLAGS \
144144
RSH_ARGS \
145+
EDGE \
145146
RSH
146147

147148
ALL_FLAGS=""
@@ -178,11 +179,7 @@ main() {
178179
VERSION="$(parse_arg "$@")"
179180
;;
180181
--edge)
181-
EDGE="$(parse_arg "$@")"
182-
shift
183-
;;
184-
--edge=*)
185-
EDGE="$(parse_arg "$@")"
182+
EDGE=1
186183
;;
187184
--rsh)
188185
RSH="$(parse_arg "$@")"

0 commit comments

Comments
 (0)