Skip to content

Commit

Permalink
fix(Zed): remove the double leading slashes on project
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier authored and pascalbreuninger committed Jan 18, 2025
1 parent 7c277f1 commit 0c6b3c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/ide/zed/zed.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import (
func Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {
log.Info("Opening Zed editor...")

sshHost := fmt.Sprintf("%s.devpod/%s", workspaceID, workspaceFolder)
if len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {
workspaceFolder = fmt.Sprintf("/%s", workspaceFolder)
}

sshHost := fmt.Sprintf("%s.devpod%s", workspaceID, workspaceFolder)
openURL := fmt.Sprintf("zed://ssh/%s", sshHost)
err := open.Run(openURL)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion pkg/ide/zed/zed_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import (
func Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {
log.Info("Opening Zed editor...")

sshHost := fmt.Sprintf("%s.devpod/%s", workspaceID, workspaceFolder)
if len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {
workspaceFolder = fmt.Sprintf("/%s", workspaceFolder)
}

sshHost := fmt.Sprintf("%s.devpod%s", workspaceID, workspaceFolder)
openURL := fmt.Sprintf("zed://ssh/%s", sshHost)
out, err := exec.Command("xdg-open", openURL).CombinedOutput()
if err != nil {
Expand Down

0 comments on commit 0c6b3c3

Please sign in to comment.