Skip to content

Commit

Permalink
balena config generate
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
myarmolinsky committed Nov 5, 2024
1 parent e33cd3f commit ea10413
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/commands/config/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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',
Expand Down Expand Up @@ -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<typeof ConfigGenerateCmd.flags>,
) {
Expand All @@ -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');
Expand Down

0 comments on commit ea10413

Please sign in to comment.