mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Prevent infinite loop
This commit is contained in:
parent
9069b07d4a
commit
8437757ca8
@ -183,15 +183,19 @@ exports.init =
|
||||
drive.writeImage params.device, params.image,
|
||||
progress: not options.quiet
|
||||
onProgress: (status) ->
|
||||
console.log(status)
|
||||
progressBar ?= new visuals.widgets.Progress('Writing device OS', status.length)
|
||||
progressBar.tick(status.delta)
|
||||
, callback
|
||||
|
||||
], (error) ->
|
||||
return done(error) if os.platform() isnt 'win32'
|
||||
windosu = require('windosu')
|
||||
if error? and error.code isnt 'EPERM'
|
||||
windosu = require('windosu')
|
||||
|
||||
# Need to escape everypath to avoid errors
|
||||
resinWritePath = "\"#{path.join(__dirname, '..', '..', 'bin', 'resin-write')}\""
|
||||
windosu.exec("node #{resinWritePath} \"#{params.image}\" \"#{params.device}\"").then ->
|
||||
console.log 'Done'
|
||||
# Need to escape everypath to avoid errors
|
||||
resinWritePath = "\"#{path.join(__dirname, '..', '..', 'bin', 'resin-write')}\""
|
||||
windosu.exec("node #{resinWritePath} \"#{params.image}\" \"#{params.device}\"").then ->
|
||||
console.log 'Done'
|
||||
else
|
||||
return done(error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user