MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / resolvePath

Function resolvePath

src/utils/autoImportSettings.ts:81–94  ·  view source on GitHub ↗

* Resolves a file path, handling home directory expansion and relative paths

(settingsPath: string)

Source from the content-addressed store, hash-verified

79 * Resolves a file path, handling home directory expansion and relative paths
80 */
81function resolvePath(settingsPath: string): string {
82 // Handle home directory expansion
83 if (settingsPath.startsWith("~/")) {
84 return path.join(os.homedir(), settingsPath.slice(2))
85 }
86
87 // Handle absolute paths
88 if (path.isAbsolute(settingsPath)) {
89 return settingsPath
90 }
91
92 // Handle relative paths (relative to home directory for safety)
93 return path.join(os.homedir(), settingsPath)
94}

Callers 1

autoImportSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected