2016-03-14 04:32:52 +01:00
|
|
|
"use strict";
|
2017-02-27 22:19:14 +01:00
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2017-01-18 00:58:09 +01:00
|
|
|
const q = require("smartq");
|
2016-10-21 17:48:52 +02:00
|
|
|
const paths = require("../npmts.paths");
|
2017-11-28 17:33:55 +01:00
|
|
|
const plugins = require("./mod.plugins");
|
|
|
|
const mod_check_1 = require("../mod_compile/mod.check");
|
2016-03-14 04:32:52 +01:00
|
|
|
exports.run = function (configArg) {
|
2016-10-02 20:35:13 +02:00
|
|
|
let done = q.defer();
|
2016-09-22 23:23:16 +02:00
|
|
|
let config = configArg;
|
2017-03-31 19:18:18 +02:00
|
|
|
plugins.beautylog.ora.text('now looking at ' + 'required assets');
|
2016-09-06 17:21:25 +02:00
|
|
|
if (config.cli === true) {
|
2017-11-28 17:33:55 +01:00
|
|
|
let mainJsPath = mod_check_1.projectInfo.packageJson.main;
|
2016-10-05 12:27:30 +02:00
|
|
|
let cliJsString = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir, 'cli.js'));
|
|
|
|
cliJsString = cliJsString.replace('{{pathToIndex}}', mainJsPath);
|
|
|
|
plugins.smartfile.memory.toFsSync(cliJsString, plugins.path.join(paths.distDir, 'cli.js'));
|
2016-09-06 17:21:25 +02:00
|
|
|
plugins.beautylog.ok('installed CLI assets!');
|
2016-03-14 04:32:52 +01:00
|
|
|
done.resolve(config);
|
|
|
|
}
|
|
|
|
else {
|
2016-09-06 17:21:25 +02:00
|
|
|
plugins.beautylog.ok('No additional assets required!');
|
2016-03-14 04:32:52 +01:00
|
|
|
done.resolve(config);
|
|
|
|
}
|
|
|
|
return done.promise;
|
|
|
|
};
|