balena-cli/lib/elevate.coffee
Juan Cruz Viotti a6dc155028 Add lodash dependency to lib/elevate.coffee
Depedency was missing and thus elevating functions threw errors.
2015-04-17 09:22:21 -04:00

17 lines
321 B
CoffeeScript

_ = 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)