-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.js
36 lines (28 loc) · 1014 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const path = require('path');
const os = require('os');
const fs = require('fs');
const FormData = require('form-data');
const Configuration = require('./configuration');
const bundle = require('./bundle');
const zip = require('./zip');
const authenticate = require('./authenticate');
const configureApp = require('./configure-app');
const createEntry = require('./create-entry');
const logger = require('./logger');
var inquirer = require('inquirer');
async function package(argv) {
try {
const projectRootPath = process.cwd();
let configuration = new Configuration(projectRootPath, argv);
await configuration.validate();
await createEntry(configuration);
await bundle(configuration);
await zip(true);
} catch(error) {
if (error.response && error.response.data) {
logger.fatal(error.response.data.error || error.response.data);
}
logger.fatal(error.stack ? error.stack : error);
}
}
module.exports = package;