forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackages.ts
31 lines (27 loc) · 820 Bytes
/
packages.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
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-implicit-dependencies
import { logging } from '@angular-devkit/core';
const { packages } = require('../lib/packages');
export default function(args: { json: boolean, version: boolean }, logger: logging.Logger) {
if (args.json) {
logger.info(JSON.stringify(packages, null, 2));
} else {
logger.info(
Object.keys(packages)
.filter(name => !packages[name].private)
.map(name => {
if (args.version) {
return `${name}@${packages[name].version}`;
} else {
return name;
}
})
.join('\n'));
}
}