GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): ignore unavailable project copy roots (#32234) · comio/opencode@409ba22

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/core
    • src/project
      • copy.ts
    • test
      • project-copy.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/core/src/project/copy.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/project/copy.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export const layer = Layer.effect(
245245
(sourceDirectory) =>
246246
Effect.forEach(strategies(), (strategy) =>
247247
strategy.list(sourceDirectory).pipe(
248+
Effect.catchTag("ProjectCopy.DirectoryUnavailableError", () => Effect.succeed([])),
248249
Effect.map((items) =>
249250
items.map((item) => ({
250251
directory: item.directory,
Collapse file

‎packages/core/test/project-copy.test.ts‎

Copy file name to clipboardExpand all lines: packages/core/test/project-copy.test.ts
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ describe("ProjectCopy", () => {
365365
}),
366366
)
367367

368+
it.live("refresh ignores existing directories that are no longer git checkouts", () =>
369+
Effect.gen(function* () {
370+
const input = yield* setup()
371+
yield* Effect.promise(() => fs.rm(path.join(input.sourceDirectory, ".git"), { recursive: true }))
372+
const copy = yield* ProjectCopy.Service
373+
374+
yield* copy.refresh({ projectID: input.projectID })
375+
376+
expect(yield* stored(input.projectID)).toEqual([{ directory: input.sourceDirectory, strategy: null }])
377+
}),
378+
)
379+
368380
it.live("refresh with no roots is a no-op", () =>
369381
Effect.gen(function* () {
370382
const copy = yield* ProjectCopy.Service

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.