Repository: cordova-cli Updated Branches: refs/heads/master c59190b53 -> 24865b92b
CB-10062 Error: EACCES: permission denied - update-notifier-cordova.json Catch permissions error and print a workaround Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/24865b92 Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/24865b92 Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/24865b92 Branch: refs/heads/master Commit: 24865b92be955c7c3d47b2a99c7dc296ba98c264 Parents: c59190b Author: daserge <[email protected]> Authored: Fri Apr 1 12:12:26 2016 +0300 Committer: daserge <[email protected]> Committed: Fri Apr 1 12:12:33 2016 +0300 ---------------------------------------------------------------------- src/cli.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/24865b92/src/cli.js ---------------------------------------------------------------------- diff --git a/src/cli.js b/src/cli.js index 567d024..b0f24b1 100644 --- a/src/cli.js +++ b/src/cli.js @@ -60,13 +60,23 @@ function init() { } function checkForUpdates() { - // Checks for available update and returns an instance - var notifier = updateNotifier({ - pkg: pkg - }); + try { + // Checks for available update and returns an instance + var notifier = updateNotifier({ + pkg: pkg + }); - // Notify using the built-in convenience method - notifier.notify(); + // Notify using the built-in convenience method + notifier.notify(); + } catch (e) { + // https://issues.apache.org/jira/browse/CB-10062 + if (e && e.message && /EACCES/.test(e.message)) { + console.log('Update notifier was not able to access the config file.\n' + + 'You may grant permissions to the file: \'sudo chmod 744 ~/.config/configstore/update-notifier-cordova.json\''); + } else { + throw e; + } + } } module.exports = cli; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
