continue-custom/core/util/pathModule.ts
2024-11-13 16:46:07 -08:00

13 lines
404 B
TypeScript

import { PlatformPath, posix, win32 } from "node:path";
import { IDE } from "..";
export type PathSep = "/" | "\\";
function getPathModuleFromPathSep(pathSep: PathSep): PlatformPath {
return pathSep === "/" ? posix : win32;
}
export async function getPathModuleForIde(ide: IDE): Promise<PlatformPath> {
const pathSep = await ide.pathSep();
return getPathModuleFromPathSep(pathSep as PathSep);
}