Skip to content

Commit a4d51f7

Browse files
committed
feat(cli): add --latest-lifecycle option for list
Output only the latest lifecycle Unity patch versions
1 parent 465ed9d commit a4d51f7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ cli.command('list', 'List changesets')
3434
.option('--minor-versions', 'Output only the available Unity minor versions')
3535
.option('--latest-patch', 'Output only the latest Unity patch versions')
3636
.option('--oldest-patch', 'Output only the oldest Unity patch versions')
37+
.option('--latest-lifecycle', 'Output only the latest lifecycle Unity patch versions')
3738
.action(options => (async () => {
3839
var results = options.all
3940
? (await scrapeArchivedChangesets()).concat(await scrapeBetaChangesets(options.latestPatch))
@@ -53,6 +54,12 @@ cli.command('list', 'List changesets')
5354
results.forEach(r => r.version = r.minor)
5455
results = Object.values(groupBy(results, r => r.version)).map(g => g[0]);
5556
}
57+
// Group by minor version and get latest lifecycle patch
58+
else if (options.latestLifecycle) {
59+
results = Object.values(groupBy(results, r => r.minor))
60+
.map(g => g.filter(v => v.lifecycle == g[0].lifecycle));
61+
results = [].concat(...results);
62+
}
5663
// Group by minor version and get latest patch
5764
else if (options.latestPatch) {
5865
results = Object.values(groupBy(results, r => r.minor)).map(g => g[0]);

0 commit comments

Comments
 (0)