cross platform expandHomePath

This commit is contained in:
Julius Marminge authored and Julius Marminge committed 2026-02-26 13:20:36 -08:00
1 parent 95419a5e51
commit be526df88a
1 file changed
+3 -3
+3 -3
View File
@@ -60,10 +60,10 @@ const CliEnvConfig = Config.all({
});
const expandHomePath = Effect.fn(function* (input: string) {
const { join } = yield* Path.Path;
const { join, sep } = yield* Path.Path;
if (input === "~") return os.homedir();
if (input.startsWith("~/")) {
return join(os.homedir(), input.slice(2));
if (input.startsWith(`~${sep}`)) {
return join(os.homedir(), input.slice(sep.length));
}
return input;
});