mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-06-05 17:21:34 +00:00
device init: Avoid extra request when not providing the --fleet option
Change-type: patch
This commit is contained in:
parent
2b58143164
commit
063e9d40f0
@ -124,21 +124,16 @@ export default class DeviceInitCmd extends Command {
|
|||||||
const balena = getBalenaSdk();
|
const balena = getBalenaSdk();
|
||||||
|
|
||||||
// Get application and
|
// Get application and
|
||||||
const application = await getApplication(
|
const application = options.fleet
|
||||||
balena,
|
? await getApplication(balena, options.fleet, {
|
||||||
options.fleet ||
|
$select: ['id', 'slug'],
|
||||||
(
|
$expand: {
|
||||||
await (await import('../../utils/patterns')).selectApplication()
|
is_for__device_type: {
|
||||||
).slug,
|
$select: 'slug',
|
||||||
{
|
},
|
||||||
$select: ['id', 'slug'],
|
|
||||||
$expand: {
|
|
||||||
is_for__device_type: {
|
|
||||||
$select: 'slug',
|
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
},
|
: await (await import('../../utils/patterns')).selectApplication();
|
||||||
);
|
|
||||||
|
|
||||||
// Register new device
|
// Register new device
|
||||||
const deviceUuid = balena.models.device.generateUniqueKey();
|
const deviceUuid = balena.models.device.generateUniqueKey();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user