mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 11:25:15 +00:00
better error message when bad directory is specified to start in
This commit is contained in:
parent
9751937894
commit
aaab785493
1 changed files with 6 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue