-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·27 lines (23 loc) · 756 Bytes
/
cli.js
File metadata and controls
executable file
·27 lines (23 loc) · 756 Bytes
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
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const john = require('./');
const platform = process.platform.toLowerCase();
const supportedPlatforms = require('./package').os;
(function () {
if (supportedPlatforms.indexOf(platform) === -1) {
return console.error(new Error(`${platform} unsupported, supported platforms: ${supportedPlatforms}`));
}
const platformLib = require(`./lib/${platform}`);
const cli = meow(
platformLib.cliHelpText(),
typeof platformLib.cliOptions === 'function' ? platformLib.cliOptions() : {}
);
john(process.cwd(), cli.flags).then(
deps => {
platformLib.cliLog(deps, 'dependencies');
console.log();
platformLib.cliLog(deps, 'devDependencies');
}
);
})();