MCPcopy Create free account
hub / github.com/nikivdev/go / openInZed

Function openInZed

cli/flow/main.go:1481–1496  ·  view source on GitHub ↗
(ctx *snap.Context, path string)

Source from the content-addressed store, hash-verified

1479}
1480
1481func openInZed(ctx *snap.Context, path string) error {
1482 zedApp := "/Applications/Zed.app"
1483 if _, err := os.Stat(zedApp); err != nil {
1484 return fmt.Errorf("Zed.app not found at %s: %w", zedApp, err)
1485 }
1486
1487 cmd := exec.Command("open", "-a", zedApp, path)
1488 cmd.Stdout = ctx.Stdout()
1489 cmd.Stderr = ctx.Stderr()
1490 cmd.Stdin = ctx.Stdin()
1491 if err := cmd.Run(); err != nil {
1492 return fmt.Errorf("open Zed: %w", err)
1493 }
1494
1495 return nil
1496}
1497
1498func tryBaseDir() (string, error) {
1499 homeDir, err := os.UserHomeDir()

Callers 1

privateForkRepoFlowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected