Skip to content

Commit

Permalink
feat: pass data string as last user message in the script dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Jun 12, 2024
1 parent e4df600 commit ccaa0e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/oclif/lib/ai-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ export abstract class AICommand extends Command {
})

if (args?.data) {
const data = args.data
if (result.hasOwnProperty('data')) {
result.data = defaultsDeep(args.data, result.data)
result.data = typeof data !== 'string' ? defaultsDeep(data, result.data) : data
} else {
Object.defineProperty(result, 'data', {
value: args.data,
value: data,
enumerable: false,
writable: true,
})
Expand Down

0 comments on commit ccaa0e1

Please sign in to comment.