| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,9 +80,9 @@ func sshCode(host, dir string, o options) error { | |||
| 80 | 80 | dlScript := downloadScript(codeServerPath) | |
| 81 | 81 | ||
| 82 | 82 | // Downloads the latest code-server and allows it to be executed. | |
| 83 | - sshCmdStr := fmt.Sprintf("ssh %v %v '/usr/bin/env bash'", o.sshFlags, host) | ||
| 83 | + sshCmdStr := fmt.Sprintf("ssh %v %v '/usr/bin/env bash -l'", o.sshFlags, host) | ||
| 84 | 84 | ||
| 85 | - sshCmd := exec.Command("sh", "-c", sshCmdStr) | ||
| 85 | + sshCmd := exec.Command("sh", "-l", "-c", sshCmdStr) | ||
| 86 | 86 | sshCmd.Stdout = os.Stdout | |
| 87 | 87 | sshCmd.Stderr = os.Stderr | |
| 88 | 88 | sshCmd.Stdin = strings.NewReader(dlScript) | |
@@ -123,7 +123,7 @@ func sshCode(host, dir string, o options) error { | |||
| 123 | 123 | ) | |
| 124 | 124 | ||
| 125 | 125 | // Starts code-server and forwards the remote port. | |
| 126 | - sshCmd = exec.Command("sh", "-c", sshCmdStr) | ||
| 126 | + sshCmd = exec.Command("sh", "-l", "-c", sshCmdStr) | ||
| 127 | 127 | sshCmd.Stdin = os.Stdin | |
| 128 | 128 | sshCmd.Stdout = os.Stdout | |
| 129 | 129 | sshCmd.Stderr = os.Stderr | |
@@ -533,7 +533,7 @@ func parseHost(host string) (parsedHost string, additionalFlags string, err erro | |||
| 533 | 533 | func parseGCPSSHCmd(instance string) (ip, sshFlags string, err error) { | |
| 534 | 534 | dryRunCmd := fmt.Sprintf("gcloud compute ssh --dry-run %v", instance) | |
| 535 | 535 | ||
| 536 | - out, err := exec.Command("sh", "-c", dryRunCmd).CombinedOutput() | ||
| 536 | + out, err := exec.Command("sh", "-l", "-c", dryRunCmd).CombinedOutput() | ||
| 537 | 537 | if err != nil { | |
| 538 | 538 | return "", "", xerrors.Errorf("%s: %w", out, err) | |
| 539 | 539 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ func TestSSHCode(t *testing.T) { | |||
| 48 | 48 | waitForSSHCode(t, remotePort, time.Second*30) | |
| 49 | 49 | ||
| 50 | 50 | // Typically we'd do an os.Stat call here but the os package doesn't expand '~' | |
| 51 | - out, err := exec.Command("sh", "-c", "stat "+codeServerPath).CombinedOutput() | ||
| 51 | + out, err := exec.Command("sh", "-l", "-c", "stat "+codeServerPath).CombinedOutput() | ||
| 52 | 52 | require.NoError(t, err, "%s", out) | |
| 53 | 53 | ||
| 54 | 54 | out, err = exec.Command("pkill", filepath.Base(codeServerPath)).CombinedOutput() | |
@@ -200,7 +200,7 @@ func handleSession(ch ssh.Channel, in <-chan *ssh.Request, t *testing.T) { | |||
| 200 | 200 | return | |
| 201 | 201 | } | |
| 202 | 202 | ||
| 203 | - cmd := exec.Command("sh", "-c", exReq.Command) | ||
| 203 | + cmd := exec.Command("sh", "-l", "-c", exReq.Command) | ||
| 204 | 204 | ||
| 205 | 205 | stdin, err := cmd.StdinPipe() | |
| 206 | 206 | require.NoError(t, err) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments