forked from ionic-team/ionic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.js
More file actions
37 lines (32 loc) · 943 Bytes
/
compile.js
File metadata and controls
37 lines (32 loc) · 943 Bytes
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
37
'use strict';
var extend = require('../utils/extend');
var IonicAppLib = require('ionic-app-lib');
var ConfigXml = IonicAppLib.configXml;
var log = IonicAppLib.logging.logger;
var cordovaUtils = require('../utils/cordova');
var settings = {
title: 'compile',
name: 'compile',
isProjectTask: true
};
function run(ionic, argv, rawCliArguments) {
var appDirectory = process.cwd();
var rawArgs = rawCliArguments.slice(0);
var cmdName = argv._[0].toLowerCase();
// ensure the content node was set back to its original
return ConfigXml.setConfigXml(appDirectory, {
resetContent: true,
errorWhenNotFound: false
}).then(function() {
var optionList = cordovaUtils.filterArgumentsForCordova(cmdName, argv, rawArgs);
return cordovaUtils.execCordovaCommand(optionList);
})
.catch(function(ex) {
if (ex instanceof Error) {
log.error(ex);
}
});
}
module.exports = extend(settings, {
run: run
});