History

chore: delete dead code, unused deps, and duplicate helpers (#9129)

Theo Browne committed 2 months ago

Commit 08aad591 parent b21d872103 files · +227 −3463Browse files

Showing the changes to apps/server/src/sourceControl/SourceControlRepositoryService.ts (1 of 103 files). Show all

Unified · Split

apps/server/src/sourceControl/SourceControlRepositoryService.ts+2−12
@@ -1,4 +1,3 @@
1−import * as NodeOS from "node:os";
21 import * as Context from "effect/Context";
32 import * as Effect from "effect/Effect";
43 import * as FileSystem from "effect/FileSystem";
@@ -20,6 +19,7 @@ import { · 15 unmodified lines
2019 } from "@t3tools/contracts";
2120
2221 import { ServerConfig } from "../config.ts";
22+import { expandHomePathWith } from "../pathExpansion.ts";
2323 import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
2424 import * as SourceControlProviderRegistry from "./SourceControlProviderRegistry.ts";
2525 const isSourceControlRepositoryError = Schema.is(SourceControlRepositoryError);
@@ -77,16 +77,6 @@ function selectRemoteUrl( · 51 unmodified lines
7777 }
7878 }
7979
80−function expandHomePath(input: string, path: Path.Path): string {
81− if (input === "~") {
82− return NodeOS.homedir();
83− }
84− if (input.startsWith("~/") || input.startsWith("~\\")) {
85− return path.join(NodeOS.homedir(), input.slice(2));
86− }
87− return input;
88−}
89−
9080 export const make = Effect.gen(function* () {
9181 const config = yield* ServerConfig;
9282 const fileSystem = yield* FileSystem.FileSystem;
@@ -137,7 +127,7 @@ export const make = Effect.gen(function* () { · 44 unmodified lines
137127 });
138128 }
139129
140− return path.resolve(expandHomePath(trimmed, path));
130+ return path.resolve(expandHomePathWith(trimmed, path));
141131 },
142132 );
143133