Skip to content

Commit

Permalink
fix: args data could accept string
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Jun 12, 2024
1 parent 68d8fff commit d0d51f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/oclif/commands/run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export default class RunScript extends AICommand {
static args = {
data: Args.string({
description: 'the json data which will be passed to the ai-agent script',
parse: (input: string) => parseJsJson(input),
parse: (input: string) => {
try {
return parseJsJson(input)
} catch(e) {
return input
}
},
})
}

Expand Down

0 comments on commit d0d51f8

Please sign in to comment.