UNPKG

ionic

Version:

A tool for creating and developing Ionic Framework mobile apps.

39 lines (33 loc) 946 B
'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: 'prepare', name: 'prepare', 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 });