diff --git a/apps/android/src/lib/workspace-path.ts b/apps/android/src/lib/workspace-path.ts new file mode 100644 index 0000000..dcbfcda --- /dev/null +++ b/apps/android/src/lib/workspace-path.ts @@ -0,0 +1,8 @@ +export function workspaceParentPath(path: string): string { + const normalized = path.replace(/[\\/]+$/, '') + const segments = normalized.split(/[\\/]+/).filter(Boolean) + const parentSegments = segments.slice(0, -1) + if (parentSegments.length === 0) return normalized.startsWith('/') ? '/' : path + const rootPrefix = normalized.startsWith('/') ? '/' : '' + return `${rootPrefix}${parentSegments.join('/')}` +}