@@ -64,6 +64,9 @@ More info: https://github.com/codercom/sshcode
64
64
"-tt" ,
65
65
host ,
66
66
`/bin/bash -c 'set -euxo pipefail || exit 1
67
+ # Make sure any currently running code-server is gone so we can overwrite
68
+ # the binary.
69
+ pkill -9 ` + filepath .Base (codeServerPath )+ ` || true
67
70
wget -q https://codesrv-ci.cdr.sh/latest-linux -O ` + codeServerPath + `
68
71
mkdir -p ~/.local/share/code-server
69
72
cd ` + filepath .Dir (codeServerPath )+ `
@@ -138,16 +141,18 @@ chmod +x `+codeServerPath+`
138
141
}
139
142
140
143
ctx , cancel = context .WithCancel (context .Background ())
144
+ openBrowser (url )
145
+
141
146
go func () {
142
147
defer cancel ()
143
- openBrowser (url )
144
148
sshCmd .Wait ()
145
149
}()
146
150
147
151
c := make (chan os.Signal )
148
152
signal .Notify (c , os .Interrupt )
149
153
150
154
var shutdownWg sync.WaitGroup
155
+
151
156
shutdownWg .Add (1 )
152
157
go func () {
153
158
defer shutdownWg .Done ()
@@ -284,7 +289,17 @@ func rsync(src string, dest string, excludePaths ...string) error {
284
289
excludeFlags [i ] = "--exclude=" + path
285
290
}
286
291
287
- cmd := exec .Command ("rsync" , append (excludeFlags , "-azv" , "--copy-unsafe-links" , src , dest )... )
292
+ cmd := exec .Command ("rsync" , append (excludeFlags , "-az" ,
293
+ "--progress" ,
294
+ "--stats" ,
295
+ // Without --size-only, synchronizing back always results in a
296
+ // full copy. For some reason, rsync with --times doesn't actually
297
+ // change modification times on the destination.
298
+ "--size-only" ,
299
+ "--copy-unsafe-links" ,
300
+ src , dest ,
301
+ )... ,
302
+ )
288
303
cmd .Stdout = os .Stdout
289
304
cmd .Stderr = os .Stderr
290
305
err := cmd .Run ()
0 commit comments