Skip to content

Commit

Permalink
change path of sh
Browse files Browse the repository at this point in the history
Signed-off-by: Rutik7066 <[email protected]>
  • Loading branch information
Rutik7066 committed Feb 4, 2025
1 parent d429595 commit f45267a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ DEV_WORKSPACES
tmp


*.exe
*.exe

main
2 changes: 1 addition & 1 deletion pkg/agent/ssh/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (s *Server) handleNonPty(session ssh.Session) {
args = append([]string{"-c"}, session.RawCommand())
}

cmd := exec.Command("/bin/sh", args...)
cmd := exec.Command("sh", args...)

cmd.Env = append(cmd.Env, os.Environ()...)

Expand Down
9 changes: 7 additions & 2 deletions pkg/ide/vscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ func OpenVSCode(activeProfile config.Profile, workspaceId, repoName string, work

func setupVSCodeCustomizations(workspaceHostname string, workspaceProviderMetadata string, tool devcontainer.Tool, codeServerPath string, settingsPath string, lockFileName string) error {
// Check if customizations are already set up
err := exec.Command("ssh", workspaceHostname, "test", "-f", fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool))).Run()
lockFileNamePath := fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool))
if runtime.GOOS == "windows" {
lockFileNamePath = fmt.Sprintf("$HOME\\%s-%s", lockFileName, string(tool))
}

err := exec.Command("ssh", workspaceHostname, "test", "-f", lockFileNamePath).Run()
if err == nil {
return nil
}
Expand Down Expand Up @@ -129,7 +134,7 @@ func setupVSCodeCustomizations(workspaceHostname string, workspaceProviderMetada
}

// Create lock file to indicate that customizations are set up
err = exec.Command("ssh", workspaceHostname, "touch", fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool))).Run()
err = exec.Command("ssh", workspaceHostname, "touch", lockFileNamePath).Run()
if err != nil {
return err
}
Expand Down

0 comments on commit f45267a

Please sign in to comment.