Skip to content

Commit 58220b8

Browse files
author
deVbug
committed
get recent code-server's releases
1 parent ceab32b commit 58220b8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

sshcode.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,16 @@ func downloadScript(codeServerPath string) string {
526526
pkill -f %v || true
527527
mkdir -p ~/.local/share/code-server %v
528528
cd %v
529-
curlflags="-o latest-linux"
530-
if [ -f latest-linux ]; then
531-
curlflags="$curlflags -z latest-linux"
529+
wget https://github.com/cdr/code-server/releases -O codeserver.rel
530+
curlurl=$(grep '/*-linux-x86_64.tar.gz' codeserver.rel | head -n 1 | sed -r 's/.* href="([^"]+)" .*/https:\/\/github.com\1/')
531+
curlflags="-L -o latest-linux.tar.gz"
532+
if [ -f latest-linux.tar.gz ]; then
533+
curlflags="$curlflags -z latest-linux.tar.gz"
532534
fi
533-
curl $curlflags https://codesrv-ci.cdr.sh/latest-linux
535+
curl $curlflags $curlurl
536+
tar xf latest-linux.tar.gz
534537
[ -f %v ] && rm %v
535-
ln latest-linux %v
538+
ln $(ls -r -1 */code-server | head -n 1) %v
536539
chmod +x %v`,
537540
codeServerPath,
538541
filepath.Dir(codeServerPath),

0 commit comments

Comments
 (0)