mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
a6dc155028
Depedency was missing and thus elevating functions threw errors.
17 lines
321 B
CoffeeScript
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)
|