1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | debugger;
|
4 | require('source-map-support/register');
|
5 | const altt_options_1 = require("./altt/altt-options");
|
6 | const env = altt_options_1.getEnvFromArgv(process.argv);
|
7 | const options = altt_options_1.getAlttOptions(env, process.cwd());
|
8 | if (!options.deploy) {
|
9 | throw new Error('Create a deploy section in altt.json');
|
10 | }
|
11 | function tryRequire(mod) {
|
12 | try {
|
13 | return require(mod).default;
|
14 | }
|
15 | catch (err) {
|
16 | return null;
|
17 | }
|
18 | }
|
19 | const modName = `@altt/altt-deploy-${options.deploy.using}`;
|
20 | const deployer = tryRequire(options.deploy.using) ||
|
21 | tryRequire(modName) ||
|
22 | tryRequire(process.cwd() + '/node_modules/' + options.deploy.using) ||
|
23 | tryRequire(process.cwd() + '/node_modules/' + modName);
|
24 | if (!deployer) {
|
25 | console.error(`Could not load ${options.deploy.using}, do you have it installed?
|
26 |
|
27 | npm install ${modName} --save-dev
|
28 | `);
|
29 | process.exit(1);
|
30 | }
|
31 | const argv = [process.argv[0], __filename, ...process.argv.slice(2)];
|
32 | deployer(env, argv).catch(err => {
|
33 | console.error(err);
|
34 | process.exit(1);
|
35 | });
|
36 |
|
\ | No newline at end of file |