mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 10:46:34 +00:00
Shorten the length of await device message
If the spinner message doesn't fit in your terminal, each spinner position will be printed in different lines. We mitigate this by dramatically shortenning the message.
This commit is contained in:
parent
97d9b7816f
commit
3149464c7a
@ -96,20 +96,20 @@
|
||||
};
|
||||
|
||||
exports.awaitDevice = function(uuid) {
|
||||
return resin.models.device.getName(uuid).then(function(deviceName) {
|
||||
var poll, spinner;
|
||||
spinner = new visuals.Spinner("Waiting for your device to come online: " + uuid);
|
||||
spinner = new visuals.Spinner("Waiting for " + deviceName + " to come online");
|
||||
poll = function() {
|
||||
return resin.models.device.isOnline(uuid).then(function(isOnline) {
|
||||
if (isOnline) {
|
||||
spinner.stop();
|
||||
console.info("Device became online: " + uuid);
|
||||
console.info("Device became online: " + deviceName);
|
||||
} else {
|
||||
spinner.start();
|
||||
return Promise.delay(3000).then(poll);
|
||||
}
|
||||
});
|
||||
};
|
||||
return resin.models.device.getName(uuid).then(function(deviceName) {
|
||||
console.info("Waiting for " + deviceName + " to connect to resin...");
|
||||
return poll()["return"](uuid);
|
||||
});
|
||||
|
@ -62,13 +62,14 @@ exports.selectProjectDirectory = ->
|
||||
default: projectsDirectory
|
||||
|
||||
exports.awaitDevice = (uuid) ->
|
||||
spinner = new visuals.Spinner("Waiting for your device to come online: #{uuid}")
|
||||
resin.models.device.getName(uuid).then (deviceName) ->
|
||||
spinner = new visuals.Spinner("Waiting for #{deviceName} to come online")
|
||||
|
||||
poll = ->
|
||||
resin.models.device.isOnline(uuid).then (isOnline) ->
|
||||
if isOnline
|
||||
spinner.stop()
|
||||
console.info("Device became online: #{uuid}")
|
||||
console.info("Device became online: #{deviceName}")
|
||||
return
|
||||
else
|
||||
|
||||
@ -78,7 +79,6 @@ exports.awaitDevice = (uuid) ->
|
||||
|
||||
return Promise.delay(3000).then(poll)
|
||||
|
||||
resin.models.device.getName(uuid).then (deviceName) ->
|
||||
console.info("Waiting for #{deviceName} to connect to resin...")
|
||||
poll().return(uuid)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user