tools/dist/npmg.install.js

36 lines
3.2 KiB
JavaScript
Raw Normal View History

2016-03-14 04:19:01 +00:00
"use strict";
2017-05-28 18:03:40 +00:00
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
2016-03-02 02:22:55 +00:00
};
2017-05-28 18:03:40 +00:00
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmg.plugins");
const paths = require("./npmg.paths");
let installExec = (packageNames) => __awaiter(this, void 0, void 0, function* () {
let installString = '';
for (let packageName of packageNames) {
installString = installString + `${packageName} `;
}
yield plugins.smartshell.exec(`yarn global remove ${installString}`);
for (let packageName of packageNames) {
plugins.beautylog.info(`now preparing ${packageName}`);
yield plugins.smartshell.exec(`yarn global remove ${packageName}`);
}
yield plugins.smartshell.exec(`yarn global add ${installString}`);
});
let packageLibrary = plugins.smartfile.fs.toObjectSync(plugins.path.join(paths.packageBase, 'package_library.json'));
exports.install = (packageSetArg) => __awaiter(this, void 0, void 0, function* () {
2016-03-02 02:22:55 +00:00
switch (packageSetArg) {
2017-05-28 18:03:40 +00:00
case 'default':
yield installExec(packageLibrary.default);
2016-03-03 01:04:14 +00:00
break;
2016-03-02 02:22:55 +00:00
default:
2017-05-28 18:03:40 +00:00
plugins.beautylog.warn('no set has been specified');
2016-03-03 01:04:14 +00:00
break;
2016-03-02 02:22:55 +00:00
}
2017-05-28 18:03:40 +00:00
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5pbnN0YWxsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtZy5pbnN0YWx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