mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-03 23:23:21 +00:00
* fix(workspaces): preserve spaces in project directory names Git path output and app workspace descriptors each stripped significant path whitespace. Preserve directory names while retaining single-record Git output validation and workspace separator normalization. * test(workspaces): capture Changes after files appear * test(workspaces): release fixtures when setup fails --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
17 lines
511 B
TypeScript
17 lines
511 B
TypeScript
import { resolve } from "node:path";
|
|
|
|
export function parseGitRevParsePath(stdout: string): string | null {
|
|
// Remove Git's record delimiter, not whitespace belonging to the path.
|
|
const path = stdout.replace(/\r?\n$/, "");
|
|
if (!path || /[\r\n]/.test(path) || path.startsWith("--")) {
|
|
return null;
|
|
}
|
|
|
|
return path;
|
|
}
|
|
|
|
export function resolveGitRevParsePath(cwd: string, stdout: string): string | null {
|
|
const parsed = parseGitRevParsePath(stdout);
|
|
return parsed ? resolve(cwd, parsed) : null;
|
|
}
|