diff --git a/lib/provisioning.js b/lib/provisioning.js index c8160be..682033c 100644 --- a/lib/provisioning.js +++ b/lib/provisioning.js @@ -68,7 +68,7 @@ function detect(options, callback) { profileDirs = getExistingProvisioningProfileDirectories(options.profileDir), results = { provisioning: { - profileDir: profileDir, + profileDir: profileDirs[0], development: [], adhoc: [], enterprise: [], @@ -253,12 +253,12 @@ function detect(options, callback) { fs.readdirSync(profileDir).forEach(function (name) { ppRegExp.test(name) && parseProfile(path.join(profileDir, name)); }); + } detectIssues(); cache = results; emitter.emit('detected', results); return callback(null, results); - } }); }; @@ -388,6 +388,10 @@ function getExistingProvisioningProfileDirectories(profileDir) { const profileDirectories = []; for (const directory of [profileDir, ...provisioningProfilesDirectories]) { + if (!directory) { + continue; + } + const resolvedDirectory = appc.fs.resolvePath(directory); if (fs.existsSync(resolvedDirectory)) {