File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ The remote host must have internet access.
2323${not_curl_usage-}
2424Usage:
2525
26- $arg0 [--dry-run] [--version X.X.X] [--method detect] \
26+ $arg0 [--dry-run] [--version X.X.X] [--edge] [-- method detect] \
2727 [--prefix ~/.local] [--rsh ssh] [user@host]
2828
2929 --dry-run
3232 --version X.X.X
3333 Install a specific version instead of the latest.
3434
35+ --edge
36+ Install the latest edge version instead of the latest stable version.
37+
3538 --method [detect | standalone]
3639 Choose the installation method. Defaults to detect.
3740 - detect detects the system package manager and tries to use it.
7174}
7275
7376echo_latest_version () {
74- # https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
75- version=" $( curl -fsSLI -o /dev/null -w " %{url_effective}" https://github.com/cdr/code-server/releases/latest) "
77+ if [ " ${EDGE-} " ]; then
78+ 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}' ) "
79+ else
80+ # https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
81+ version=" $( curl -fsSLI -o /dev/null -w " %{url_effective}" https://github.com/cdr/code-server/releases/latest) "
82+ fi
7683 version=" ${version# https:// github.com/ cdr/ code-server/ releases/ tag/ } "
7784 version=" ${version# v} "
7885 echo " $version "
@@ -135,6 +142,7 @@ main() {
135142 OPTIONAL \
136143 ALL_FLAGS \
137144 RSH_ARGS \
145+ EDGE \
138146 RSH
139147
140148 ALL_FLAGS=" "
@@ -170,6 +178,9 @@ main() {
170178 --version=* )
171179 VERSION=" $( parse_arg " $@ " ) "
172180 ;;
181+ --edge)
182+ EDGE=1
183+ ;;
173184 --rsh)
174185 RSH=" $( parse_arg " $@ " ) "
175186 shift
You can’t perform that action at this time.
0 commit comments