Kill preexisting sshcode remote process for a user · coder/sshcode@2f80f3f

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

File tree

2 files changed

lines changed

2 files changed

lines changed

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,

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,