Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

Commit 4bbf059

Browse files
authored
Merge pull request #87 from cdr/kill-code
Kill preexisting sshcode remote process for a user
2 parents 804c11e + 2f80f3f commit 4bbf059

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sshcode.go

+2
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,14 @@ func downloadScript(codeServerPath string) string {
321321
return fmt.Sprintf(
322322
`set -euxo pipefail || exit 1
323323
324+
pkill -f %v || true
324325
mkdir -p ~/.local/share/code-server %v
325326
cd %v
326327
wget -N https://codesrv-ci.cdr.sh/latest-linux
327328
[ -f %v ] && rm %v
328329
ln latest-linux %v
329330
chmod +x %v`,
331+
codeServerPath,
330332
filepath.Dir(codeServerPath),
331333
filepath.Dir(codeServerPath),
332334
codeServerPath,

sshcode_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestSSHCode(t *testing.T) {
4040
wg.Add(1)
4141
go func() {
4242
defer wg.Done()
43-
err := sshCode("127.0.0.1", "", options{
43+
err := sshCode("foo@127.0.0.1", "", options{
4444
sshFlags: testSSHArgs(sshPort),
4545
localPort: localPort,
4646
remotePort: remotePort,

0 commit comments

Comments
 (0)