-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·37 lines (30 loc) · 996 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env node
const { program } = require('commander');
const updater = require('./src/updater');
program
.version('1.0.0')
.description('Automated Dependency Updater CLI Tool');
program
.option('-p, --platform <platform>', 'Specify the platform (github, gitlab, bitbucket)', 'github')
.option('-v, --verbose', 'Enable verbose logging');
program
.command('run')
.description('Run the dependency updater')
.action(() => {
const options = program.opts();
updater.runUpdateProcess(options.platform, options.verbose);
});
program
.command('schedule <cronExpression>')
.description('Schedule the updater with a cron expression')
.action((cronExpression) => {
const options = program.opts();
updater.scheduleUpdates(cronExpression, options.platform, options.verbose);
});
program
.command('*')
.action(() => {
const options = program.opts();
updater.runUpdateProcess(options.platform, options.verbose);
});
program.parse(process.argv);