-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.ts
42 lines (37 loc) · 1.01 KB
/
command.ts
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
38
39
40
41
42
#!/usr/bin/env bun
import { Command } from 'commander';
import { terminator } from './src/utils/delete-tags';
import { description, version, name } from './package.json';
const command = new Command();
command
.name(name)
.description(description)
.version(version)
.requiredOption(
'-t, --time <time>',
'Time until a tag is considered stale in days',
'365'
)
.requiredOption(
'-o, --organization <organization>',
'GitHub Organization'
)
.option(
'-r, --repository <repository...>',
'Target repositories'
)
.option(
'-n, --minimumTags <minimum>',
'Minimum number of Tags to preserve',
'10'
)
.option('--dry', 'Dry run command', false)
.action((options) => {
const daysUntilStale = options.time.trim();
const org = options.organization.trim();
const repositories = options.repository;
const minTags = options.minimumTags.trim();
const dry = options.dry;
terminator(daysUntilStale, org, repositories, minTags, dry);
});
command.parse();