mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 00:03:13 +03:00
fix(desktop): show an error when opening a path in the default app fails (#62572)
This commit is contained in:
committed by
GitHub
Unverified
parent
a687c047af
commit
088682cb1e
@@ -124,7 +124,13 @@ function make(
|
||||
return true
|
||||
}),
|
||||
openPath: Effect.fn("DesktopFiles.openPath")(function* (target: string, application?: string) {
|
||||
if (!application) return yield* Effect.promise(() => shell.openPath(target))
|
||||
if (!application) {
|
||||
const error = yield* Effect.promise(() => shell.openPath(target))
|
||||
|
||||
if (error) return yield* Effect.fail(new Error(error))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (process.platform === "win32" && /^powershell(\.exe)?$/i.test(path.basename(application))) {
|
||||
const info = yield* fs.stat(target)
|
||||
|
||||
Reference in New Issue
Block a user