From e665411ffb2bf3c70d8e84302410044c2f6c6972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Sat, 28 Sep 2024 23:24:55 +0200 Subject: [PATCH] chore: only warn about missing profiles if there are any --- lib/provisioning.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/provisioning.js b/lib/provisioning.js index 682033c..0ab2e8e 100644 --- a/lib/provisioning.js +++ b/lib/provisioning.js @@ -83,8 +83,8 @@ function detect(options, callback) { distribution: 0 }, - ppRegExp = /.*\.(mobileprovision|provisionprofile)$/; - + ppRegExp = /.*\.(mobileprovision|provisionprofile)$/; + if (options.watch) { var throttleTimer = null; @@ -141,7 +141,7 @@ function detect(options, callback) { function detectIssues() { results.issues = []; - if (!results.provisioning.development.length || !valid.development) { + if (results.provisioning.development.length >0 && !valid.development) { results.issues.push({ id: 'IOS_NO_VALID_DEVELOPMENT_PROVISIONING_PROFILES', type: 'warning', @@ -150,7 +150,7 @@ function detect(options, callback) { }); } - if (!results.provisioning.adhoc.length || !valid.adhoc) { + if (results.provisioning.adhoc.length > 0 && !valid.adhoc) { results.issues.push({ id: 'IOS_NO_VALID_ADHOC_PROVISIONING_PROFILES', type: 'warning', @@ -159,7 +159,7 @@ function detect(options, callback) { }); } - if (!results.provisioning.distribution.length || !valid.distribution) { + if (results.provisioning.distribution.length > 0 && !valid.distribution) { results.issues.push({ id: 'IOS_NO_VALID_DISTRIBUTION_PROVISIONING_PROFILES', type: 'warning', @@ -255,10 +255,10 @@ function detect(options, callback) { }); } - detectIssues(); - cache = results; - emitter.emit('detected', results); - return callback(null, results); + detectIssues(); + cache = results; + emitter.emit('detected', results); + return callback(null, results); }); };