summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-06-24 22:28:25 -0400
committerDax Raad <[email protected]>2025-06-24 22:28:25 -0400
commitaaab785493e749fb232983a39e3c9e2b78e2e415 (patch)
tree9718a549ecdec64fb54abf9fbdd4a6eaa3af4d9e /packages
parent97519378949280e1fa1e88ed13549d9a7296825a (diff)
downloadopencode-aaab785493e749fb232983a39e3c9e2b78e2e415.tar.gz
opencode-aaab785493e749fb232983a39e3c9e2b78e2e415.zip
better error message when bad directory is specified to start in
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts
index 40bed85cb..ca8c3d5b0 100644
--- a/packages/opencode/src/index.ts
+++ b/packages/opencode/src/index.ts
@@ -54,7 +54,12 @@ const cli = yargs(hideBin(process.argv))
handler: async (args) => {
while (true) {
const cwd = args.project ? path.resolve(args.project) : process.cwd()
- process.chdir(cwd)
+ try {
+ process.chdir(cwd)
+ } catch (e) {
+ UI.error("Failed to change directory to " + cwd)
+ return
+ }
const result = await App.provide({ cwd }, async (app) => {
const providers = await Provider.list()
if (Object.keys(providers).length === 0) {