From 2f80f3f35ebf62e80bddbf81ef5f0c79b6526daa Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Wed, 1 May 2019 20:18:08 -0500 Subject: [PATCH] Kill preexisting sshcode remote process for a user --- sshcode.go | 2 ++ sshcode_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sshcode.go b/sshcode.go index 5ffda40..e3bfd02 100644 --- a/sshcode.go +++ b/sshcode.go @@ -321,12 +321,14 @@ func downloadScript(codeServerPath string) string { return fmt.Sprintf( `set -euxo pipefail || exit 1 +pkill -f %v || true mkdir -p ~/.local/share/code-server %v cd %v wget -N https://codesrv-ci.cdr.sh/latest-linux [ -f %v ] && rm %v ln latest-linux %v chmod +x %v`, + codeServerPath, filepath.Dir(codeServerPath), filepath.Dir(codeServerPath), codeServerPath, diff --git a/sshcode_test.go b/sshcode_test.go index 318f7da..f6bd681 100644 --- a/sshcode_test.go +++ b/sshcode_test.go @@ -40,7 +40,7 @@ func TestSSHCode(t *testing.T) { wg.Add(1) go func() { defer wg.Done() - err := sshCode("127.0.0.1", "", options{ + err := sshCode("foo@127.0.0.1", "", options{ sshFlags: testSSHArgs(sshPort), localPort: localPort, remotePort: remotePort,