1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const path = require("path");
|
4 | const semver = require("semver");
|
5 | function checkCWD() {
|
6 | try {
|
7 | process.cwd();
|
8 | }
|
9 | catch (error) {
|
10 | if (error.code === 'ENOENT') {
|
11 | process.stderr.write('WARNING: current directory does not exist\n');
|
12 | }
|
13 | }
|
14 | }
|
15 | function checkNodeVersion() {
|
16 | const root = path.join(__dirname, '..');
|
17 | const pjson = require(path.join(root, 'package.json'));
|
18 | if (!semver.satisfies(process.versions.node, pjson.engines.node)) {
|
19 | process.stderr.write(`WARNING\nWARNING Node version must be ${pjson.engines.node} to use this CLI\nWARNING Current node version: ${process.versions.node}\nWARNING\n`);
|
20 | }
|
21 | }
|
22 | checkCWD();
|
23 | checkNodeVersion();
|
24 | const command_1 = require("./command");
|
25 | exports.Command = command_1.default;
|
26 | const flags = require("./flags");
|
27 | exports.flags = flags;
|
28 | var main_1 = require("./main");
|
29 | exports.run = main_1.run;
|
30 | exports.Main = main_1.Main;
|
31 | exports.default = command_1.default;
|