mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-28 17:48:50 +00:00
16 lines
299 B
CoffeeScript
16 lines
299 B
CoffeeScript
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)
|