@dojo/cli
Version:
34 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const yargs = require("yargs");
const updateNotifier_1 = require("./updateNotifier");
const registerCommands_1 = require("./registerCommands");
const path_1 = require("path");
const allCommands_1 = require("./allCommands");
const installableCommands_1 = require("./installableCommands");
const configurationHelper_1 = require("./configurationHelper");
const pkgDir = require('pkg-dir');
function init() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
try {
const packagePath = pkgDir.sync(__dirname);
const packageJsonFilePath = path_1.join(packagePath, 'package.json');
const packageJson = require(packageJsonFilePath);
updateNotifier_1.default(packageJson);
const availableCommands = yield installableCommands_1.default(packageJson.name);
const allCommands = yield allCommands_1.default();
const mergedCommands = installableCommands_1.mergeInstalledCommandsWithAvailableCommands(allCommands, availableCommands);
registerCommands_1.default(yargs, mergedCommands);
}
catch (err) {
console.log(`Commands are not available:\n ${err.message}`);
}
try {
configurationHelper_1.checkForMultiConfig();
}
catch (_a) { }
});
}
exports.init = init;
//# sourceMappingURL=index.js.map