mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Merge pull request #207 from resin-io/jviotti/fix/promise-using
Fix incorrect Promise.using syntax
This commit is contained in:
commit
0443a35f2b
@ -142,18 +142,18 @@
|
||||
var download;
|
||||
download = function() {
|
||||
return tmp.tmpNameAsync().then(function(temporalPath) {
|
||||
return capitano.runAsync("os download --output " + temporalPath);
|
||||
return capitano.runAsync("os download " + application.device_type + " --output " + temporalPath);
|
||||
}).disposer(_.ary(rimraf, 1));
|
||||
};
|
||||
return Promise.using(download()).then(function(temporalPath) {
|
||||
return Promise.using(download(), function(temporalPath) {
|
||||
return capitano.runAsync("device register " + application.app_name).then(resin.models.device.get).tap(function(device) {
|
||||
return capitano.runAsync("os configure " + temporalPath + " " + device.uuid).then(function() {
|
||||
return capitano.runAsync("os initialize " + temporalPath + " " + device.uuid);
|
||||
});
|
||||
}).then(function(device) {
|
||||
console.log('Done');
|
||||
return device.uuid;
|
||||
});
|
||||
}).then(function(device) {
|
||||
console.log('Done');
|
||||
return device.uuid;
|
||||
});
|
||||
}).nodeify(done);
|
||||
}
|
||||
|
@ -198,17 +198,17 @@ exports.init =
|
||||
|
||||
download = ->
|
||||
tmp.tmpNameAsync().then (temporalPath) ->
|
||||
capitano.runAsync("os download --output #{temporalPath}")
|
||||
capitano.runAsync("os download #{application.device_type} --output #{temporalPath}")
|
||||
.disposer(_.ary(rimraf, 1))
|
||||
|
||||
Promise.using(download()).then (temporalPath) ->
|
||||
Promise.using download(), (temporalPath) ->
|
||||
capitano.runAsync("device register #{application.app_name}")
|
||||
.then(resin.models.device.get)
|
||||
.tap (device) ->
|
||||
capitano.runAsync("os configure #{temporalPath} #{device.uuid}").then ->
|
||||
capitano.runAsync("os initialize #{temporalPath} #{device.uuid}")
|
||||
.then (device) ->
|
||||
console.log('Done')
|
||||
return device.uuid
|
||||
.then (device) ->
|
||||
console.log('Done')
|
||||
return device.uuid
|
||||
|
||||
.nodeify(done)
|
||||
|
Loading…
Reference in New Issue
Block a user