MCPcopy
hub / github.com/Fission-AI/OpenSpec / joinPath

Method joinPath

src/utils/file-system.ts:117–132  ·  view source on GitHub ↗
(basePath: string, ...segments: string[])

Source from the content-addressed store, hash-verified

115 }
116
117 static joinPath(basePath: string, ...segments: string[]): string {
118 const normalizedSegments = this.normalizeSegments(segments);
119
120 if (this.isWindowsBasePath(basePath)) {
121 const normalizedBasePath = path.win32.normalize(basePath);
122 return normalizedSegments.length
123 ? path.win32.join(normalizedBasePath, ...normalizedSegments)
124 : normalizedBasePath;
125 }
126
127 const posixBasePath = basePath.replace(/\\/g, '/');
128
129 return normalizedSegments.length
130 ? path.posix.join(posixBasePath, ...normalizedSegments)
131 : path.posix.normalize(posixBasePath);
132 }
133
134 static async createDirectory(dirPath: string): Promise<void> {
135 await fs.mkdir(dirPath, { recursive: true });

Callers 11

detectLegacyConfigFilesFunction · 0.80
cleanupLegacyArtifactsFunction · 0.80
getChangeDirFunction · 0.80
getWorksetsDirFunction · 0.80
getWorksetsFilePathFunction · 0.80
joinStorePathFunction · 0.80

Calls 2

normalizeSegmentsMethod · 0.95
isWindowsBasePathMethod · 0.95

Tested by

no test coverage detected