MCPcopy Index your code
hub / github.com/nikivdev/go / resolveWorkspaceFilePath

Function resolveWorkspaceFilePath

workspace.go:235–267  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

233}
234
235func resolveWorkspaceFilePath(raw string) (string, error) {
236 path := strings.TrimSpace(raw)
237 if path == "" {
238 if env := os.Getenv("FLOW_WORKSPACE_FILE"); strings.TrimSpace(env) != "" {
239 path = env
240 }
241 }
242 if path == "" {
243 home, err := os.UserHomeDir()
244 if err != nil {
245 return "", fmt.Errorf("determine home directory: %w", err)
246 }
247 path = filepath.Join(
248 home,
249 "Library",
250 "Application Support",
251 "RepoPrompt",
252 "Workspaces",
253 "Workspace-main-7E67B1B3-FCB7-4C1A-AD0E-476742996DB4",
254 "workspace.json",
255 )
256 }
257
258 expanded, err := expandUserPath(path)
259 if err != nil {
260 return "", fmt.Errorf("expand workspace file path: %w", err)
261 }
262 final, err := filepath.Abs(expanded)
263 if err != nil {
264 return "", fmt.Errorf("resolve workspace file path: %w", err)
265 }
266 return filepath.Clean(final), nil
267}
268
269func workspacePathsCmd(ctx *snap.Context) error {
270 var args []string

Callers 1

workspacePathsCmdFunction · 0.70

Calls 1

expandUserPathFunction · 0.70

Tested by

no test coverage detected