fix invalid js comment, make payee optional
This commit is contained in:
parent
32b5a0d0a5
commit
bb1fcb3d94
6
cli.js
6
cli.js
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
# Note: mostly generated by ChatGPT, I am not a Javascript developer
|
// Note: mostly generated by ChatGPT, I am not a Javascript developer
|
||||||
|
|
||||||
const actual = require('@actual-app/api');
|
const actual = require('@actual-app/api');
|
||||||
const yargs = require('yargs/yargs');
|
const yargs = require('yargs/yargs');
|
||||||
@ -17,7 +17,7 @@ const { hideBin } = require('yargs/helpers');
|
|||||||
.option('payee', {
|
.option('payee', {
|
||||||
alias: 'p',
|
alias: 'p',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
demandOption: true,
|
demandOption: false,
|
||||||
describe: 'The name of the payee',
|
describe: 'The name of the payee',
|
||||||
})
|
})
|
||||||
.option('amount', {
|
.option('amount', {
|
||||||
@ -63,7 +63,7 @@ const { hideBin } = require('yargs/helpers');
|
|||||||
|
|
||||||
await actual.importTransactions(argv.account, [{
|
await actual.importTransactions(argv.account, [{
|
||||||
imported_payee: argv.payee,
|
imported_payee: argv.payee,
|
||||||
payee_name: argv.payee,
|
payee_name: argv.payee ?? '',
|
||||||
amount,
|
amount,
|
||||||
date: argv.date, // today's date
|
date: argv.date, // today's date
|
||||||
notes: argv.notes ?? ''
|
notes: argv.notes ?? ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user