sda
Version:
Software development assistant
36 lines • 1.44 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Log_1 = __importDefault(require("../Log"));
const attachEnvironmentAfterExecute_1 = __importDefault(require("./attachEnvironmentAfterExecute"));
const runCommands_1 = __importDefault(require("./runCommands"));
function setupEnvironment(ec) {
Log_1.default.verbose('Set up environment');
Log_1.default.verbose('');
attachEnvironmentAfterExecute_1.default(ec, (params) => {
const { template, path } = params;
if (!template.commands.setup) {
const gitRepo = template.gitRepo;
if (gitRepo) {
template.commands.setup = `git clone ${gitRepo} ${path}`;
}
else {
throw new Error(`The template "${template.id}" doesn't support the setup command.`);
}
}
ec.commands = [];
if (template.commands['pre-setup']) {
ec.commands.push('pre-setup');
}
ec.commands.push('setup');
if (template.commands['post-setup']) {
ec.commands.push('post-setup');
}
ec.params = [];
runCommands_1.default(ec);
});
}
exports.default = setupEnvironment;
//# sourceMappingURL=setupEnvironment.js.map