mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-11 15:04:00 +00:00
Merge pull request #175 from resin-io/jviotti/fix/update-root
Don't check for available updates when running as root
This commit is contained in:
commit
7f763e7881
@ -1,13 +1,17 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var notifier, packageJSON, updateNotifier;
|
var isRoot, notifier, packageJSON, updateNotifier;
|
||||||
|
|
||||||
updateNotifier = require('update-notifier');
|
updateNotifier = require('update-notifier');
|
||||||
|
|
||||||
|
isRoot = require('is-root');
|
||||||
|
|
||||||
packageJSON = require('../../package.json');
|
packageJSON = require('../../package.json');
|
||||||
|
|
||||||
notifier = updateNotifier({
|
if (!isRoot()) {
|
||||||
pkg: packageJSON
|
notifier = updateNotifier({
|
||||||
});
|
pkg: packageJSON
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
exports.hasAvailableUpdate = function() {
|
exports.hasAvailableUpdate = function() {
|
||||||
return notifier != null;
|
return notifier != null;
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
updateNotifier = require('update-notifier')
|
updateNotifier = require('update-notifier')
|
||||||
|
isRoot = require('is-root')
|
||||||
packageJSON = require('../../package.json')
|
packageJSON = require('../../package.json')
|
||||||
|
|
||||||
notifier = updateNotifier(pkg: packageJSON)
|
# `update-notifier` creates files to make the next
|
||||||
|
# running time ask for updated, however this can lead
|
||||||
|
# to ugly EPERM issues if those files are created as root.
|
||||||
|
if not isRoot()
|
||||||
|
notifier = updateNotifier(pkg: packageJSON)
|
||||||
|
|
||||||
exports.hasAvailableUpdate = ->
|
exports.hasAvailableUpdate = ->
|
||||||
return notifier?
|
return notifier?
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
"coffee-script": "^1.9.3",
|
"coffee-script": "^1.9.3",
|
||||||
"columnify": "^1.5.2",
|
"columnify": "^1.5.2",
|
||||||
"html-to-text": "^1.3.1",
|
"html-to-text": "^1.3.1",
|
||||||
|
"is-root": "^1.0.0",
|
||||||
"lodash": "^3.10.0",
|
"lodash": "^3.10.0",
|
||||||
"mkdirp": "~0.5.0",
|
"mkdirp": "~0.5.0",
|
||||||
"nplugm": "^3.0.0",
|
"nplugm": "^3.0.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user