Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
fix(start): fixed issue where cordova install test did not account fo…
Browse files Browse the repository at this point in the history
…r promise.
  • Loading branch information
jthoms1 committed Nov 9, 2016
1 parent fed9573 commit 1ad2da0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
32 changes: 17 additions & 15 deletions lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,27 +733,29 @@ Start.initCordovaNoCli = function initCordova(options, appSetup) {
};

Start.initCordova = function(options, appSetup) {
var q;
try {
if (!options.isCordovaProject) {
log.info('not a cordova project, no cordova options to initialize');
return Q.resolve();
}

Hooks.setHooksPermission(options.targetPath);

log.info('\nAdding initial native plugins');
if (!options.isCordovaProject) {
log.info('not a cordova project, no cordova options to initialize');
return Q.resolve();
}

Hooks.setHooksPermission(options.targetPath);

appSetup.bower = appSetup.bower ? appSetup.bower : [];
log.info('\nAdding initial native plugins');

if (!Utils.cordovaInstalled()) {
appSetup.bower = appSetup.bower ? appSetup.bower : [];

// console.log('utils cordova not installed');
return Utils.cordovaInstalled().then(function(isCordovaInstalled) {
if (isCordovaInstalled) {
return Start.initCordovaNoCli(options, appSetup);
}
return rInitCordova(options, appSetup);
});
};

q = Q.defer();
function rInitCordova(options, appSetup) {
var q = Q.defer();

try {
var cmds = [];

// add plugins
Expand Down Expand Up @@ -815,7 +817,7 @@ Start.initCordova = function(options, appSetup) {
}

return q.promise;
};
}

Start.updateConfigXml = function(targetPath, packageName, appName) {
var q = Q.defer();
Expand Down
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ Utils.gulpInstalledGlobally = function gulpInstalledGlobally() {

Utils.cordovaInstalled = function cordovaInstalled() {
var Info = require('./info');
var info = {};
Info.getCordovaInfo(info);

return info.cordova !== 'Not installed';
return Info.gatherInfo().then(function(info) {
return info.cordova !== 'Not installed';
});
};

Utils.findIonicRoot = function findIonicRoot(dir) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic-app-lib",
"version": "2.1.3",
"version": "2.1.4",
"description": "A library for creating and developing Ionic Framework mobile apps.",
"homepage": "http://ionicframework.com/",
"main": "index.js",
Expand Down

0 comments on commit 1ad2da0

Please sign in to comment.