python切换node的版本
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { config } from './config.js';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const command = args[0] || 'sync';
|
||||
const extraArgs = args.slice(1);
|
||||
@@ -9,7 +11,7 @@ for (const arg of extraArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
const { login, scheduleSync, syncAll, syncBillsOnly } = await import('./sync.js');
|
||||
const { login, scheduleSync, syncAll, syncAllIncremental, syncBillsOnly, syncMessagesOnly } = await import('./sync.js');
|
||||
|
||||
if (command === 'login') {
|
||||
await login();
|
||||
@@ -22,12 +24,24 @@ if (command === 'sync') {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === 'incremental') {
|
||||
const summary = await syncAllIncremental();
|
||||
console.log(JSON.stringify(summary, null, 2));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === 'bills') {
|
||||
const summary = await syncBillsOnly({ resume: billsResume });
|
||||
console.log(JSON.stringify(summary, null, 2));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === 'messages') {
|
||||
const summary = await syncMessagesOnly({ incremental: config.scheduleMode === 'incremental' });
|
||||
console.log(JSON.stringify(summary, null, 2));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === 'schedule') {
|
||||
await scheduleSync();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user