MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / detectWorkspacePaths

Function detectWorkspacePaths

internal/cli/workspace_context_detect.go:73–95  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

71}
72
73func detectWorkspacePaths(dir string) *models.WorkspacePaths {
74 paths := &models.WorkspacePaths{
75 Root: ".",
76 }
77 if fileExists(filepath.Join(dir, "..", "pad-web"), "package.json") {
78 paths.DocsRepo = "../pad-web"
79 }
80 if fileExists(dir, "package.json") {
81 paths.Web = "."
82 } else if dirExists(dir, "web") {
83 paths.Web = "web"
84 }
85 if dirExists(dir, "internal", "server") {
86 paths.Server = "internal/server"
87 }
88 if dirExists(dir, "skills") {
89 paths.Skills = "skills"
90 }
91 if fileExists(dir, ".pad.toml") {
92 paths.Config = ".pad.toml"
93 }
94 return paths
95}
96
97func detectWorkspaceCommands(info ProjectInfo) *models.WorkspaceCommands {
98 return &models.WorkspaceCommands{

Callers 1

BuildWorkspaceContextFunction · 0.85

Calls 3

fileExistsFunction · 0.85
dirExistsFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected