From 0acf3eb53fd85b29a7a0dd699ab9966adeca4195 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 5 Nov 2024 07:08:53 -0500 Subject: [PATCH] `balena config generate` Change-type: patch --- src/commands/config/generate.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/commands/config/generate.ts b/src/commands/config/generate.ts index a2002853d..202607c1a 100644 --- a/src/commands/config/generate.ts +++ b/src/commands/config/generate.ts @@ -64,7 +64,7 @@ export default class ConfigGenerateCmd extends Command { description: 'a balenaOS version', required: true, }), - fleet: { ...cf.fleet(), exclusive: ['device'] }, + fleet: cf.fleet({ exclusive: ['device'] }), dev: cf.dev, secureBoot: cf.secureBoot, device: { @@ -83,6 +83,7 @@ export default class ConfigGenerateCmd extends Command { deviceType: Flags.string({ description: "device type slug (run 'balena device-type list' for possible values)", + dependsOn: ['fleet'], }), 'generate-device-api-key': Flags.boolean({ description: 'generate a fresh device key for the device', @@ -240,9 +241,6 @@ export default class ConfigGenerateCmd extends Command { $ balena help config generate `; - protected readonly deviceTypeNotAllowedMessage = - 'The --deviceType option can only be used alongside the --fleet option'; - protected async validateOptions( options: Interfaces.InferredFlags, ) { @@ -252,9 +250,6 @@ export default class ConfigGenerateCmd extends Command { throw new ExpectedError(this.missingDeviceOrAppMessage); } - if (!options.fleet && options.deviceType) { - throw new ExpectedError(this.deviceTypeNotAllowedMessage); - } const { normalizeOsVersion } = await import('../../utils/normalization'); options.version = normalizeOsVersion(options.version); const { validateDevOptionAndWarn } = await import('../../utils/config');