UNPKG

1.34 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3require('source-map-support/register');
4const altt_function_1 = require("./altt/altt-function");
5const altt_options_1 = require("./altt/altt-options");
6const commander = require("commander");
7const bluebird_1 = require("bluebird");
8const altt_build_1 = require("./altt/altt-build");
9let functionNames = [];
10commander
11 .option('-e', '--environment [environment]', 'Environment')
12 .action(function (name, otherNames) {
13 functionNames.push(name);
14 functionNames.concat(otherNames);
15})
16 .parse(process.argv);
17const env = commander.environment;
18const rootDir = altt_options_1.getRootDir(env);
19async function functionsRequiringBuild() {
20 const allFunctions = await altt_function_1.getAllFunctions(env, rootDir);
21 return await bluebird_1.Promise.filter(allFunctions, altt_build_1.requiresBuild);
22}
23async function main(functionNames) {
24 const rootDir = altt_options_1.getRootDir(env);
25 const functions = functionNames.length > 0
26 ? functionNames.map(name => altt_function_1.alttFunction(name, env, rootDir))
27 : await functionsRequiringBuild();
28 return Promise.all(functions.map(altt_build_1.build));
29}
30main(functionNames).catch(err => {
31 console.error(err);
32 process.exit(1);
33});
34//# sourceMappingURL=altt-build.js.map
\No newline at end of file