History

port desktop app to Effect (#2546)

Julius Marminge committed 6 months ago

Commit aa219be1 parent dd32f52186 files · +13522 −7058Browse files

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

Unified · Split

apps/server/src/sourceControl/SourceControlRepositoryService.ts+15−21
@@ -153,13 +153,11 @@ export const make = Effect.fn("makeSourceControlRepositoryService")(function* () · 152 unmodified lines
153153 function* (destinationPath: string) {
154154 const trimmed = destinationPath.trim();
155155 if (trimmed.length === 0) {
156− return yield* Effect.fail(
157− repositoryError({
158− operation: "cloneRepository",
159− provider: "unknown",
160− detail: "Choose a destination path before cloning.",
161− }),
162− );
156+ return yield* repositoryError({
157+ operation: "cloneRepository",
158+ provider: "unknown",
159+ detail: "Choose a destination path before cloning.",
160+ });
163161 }
164162
165163 return path.resolve(expandHomePath(trimmed, path));
@@ -183,13 +181,11 @@ export const make = Effect.fn("makeSourceControlRepositoryService")(function* () · 17 unmodified lines
183181 ),
184182 );
185183 if (entries.length > 0) {
186− return yield* Effect.fail(
187− repositoryError({
188− operation: "cloneRepository",
189− provider: "unknown",
190− detail: "Destination path already exists and is not empty.",
191− }),
192− );
184+ return yield* repositoryError({
185+ operation: "cloneRepository",
186+ provider: "unknown",
187+ detail: "Destination path already exists and is not empty.",
188+ });
193189 }
194190 } else {
195191 yield* fileSystem.makeDirectory(path.dirname(normalizedDestination), { recursive: true });
@@ -222,13 +218,11 @@ export const make = Effect.fn("makeSourceControlRepositoryService")(function* () · 26 unmodified lines
222218 }
223219
224220 if (!remoteUrl) {
225− return yield* Effect.fail(
226− repositoryError({
227− operation: "cloneRepository",
228− provider,
229− detail: "Enter a repository path or clone URL before cloning.",
230− }),
231− );
221+ return yield* repositoryError({
222+ operation: "cloneRepository",
223+ provider,
224+ detail: "Enter a repository path or clone URL before cloning.",
225+ });
232226 }
233227
234228 yield* git.execute({