mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Merge pull request #140 from resin-io/jviotti/cleanup/elevate
Remove outdated Windows elevation mechanism
This commit is contained in:
commit
4157f21e06
@ -1,25 +0,0 @@
|
||||
(function() {
|
||||
var _, isWindows, os, path;
|
||||
|
||||
_ = require('lodash');
|
||||
|
||||
os = require('os');
|
||||
|
||||
path = require('path');
|
||||
|
||||
isWindows = function() {
|
||||
return os.platform() === 'win32';
|
||||
};
|
||||
|
||||
exports.shouldElevate = function(error) {
|
||||
return _.all([isWindows(), error.code === 'EPERM' || error.code === 'EACCES']);
|
||||
};
|
||||
|
||||
exports.run = function(command) {
|
||||
if (!isWindows()) {
|
||||
return;
|
||||
}
|
||||
return require('windosu').exec(command);
|
||||
};
|
||||
|
||||
}).call(this);
|
@ -1,16 +0,0 @@
|
||||
_ = require('lodash')
|
||||
os = require('os')
|
||||
path = require('path')
|
||||
|
||||
isWindows = ->
|
||||
return os.platform() is 'win32'
|
||||
|
||||
exports.shouldElevate = (error) ->
|
||||
return _.all [
|
||||
isWindows()
|
||||
error.code is 'EPERM' or error.code is 'EACCES'
|
||||
]
|
||||
|
||||
exports.run = (command) ->
|
||||
return if not isWindows()
|
||||
require('windosu').exec(command)
|
@ -23,9 +23,6 @@
|
||||
],
|
||||
"author": "Juan Cruz Viotti <juanchiviotti@gmail.com>",
|
||||
"license": "MIT",
|
||||
"optionalDependencies": {
|
||||
"windosu": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.0.0",
|
||||
"ent": "^2.2.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user