From c4ab329d04f59043b03aa3bea13c71cd88428275 Mon Sep 17 00:00:00 2001 From: Thodoris Greasidis Date: Tue, 31 Dec 2024 19:02:18 +0200 Subject: [PATCH] os build-config: Deprecate the --device-type parameter Change-type: patch --- src/commands/os/build-config.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/commands/os/build-config.ts b/src/commands/os/build-config.ts index 7a15613b59..bfa8bd3d09 100644 --- a/src/commands/os/build-config.ts +++ b/src/commands/os/build-config.ts @@ -38,6 +38,7 @@ export default class OsBuildConfigCmd extends Command { description: 'os image', required: true, }), + // TODO: Drop this arg on the next major 'device-type': Args.string({ description: 'device type', required: true, @@ -63,6 +64,12 @@ export default class OsBuildConfigCmd extends Command { const { writeFile } = (await import('fs')).promises; + // the "device-type" arg will be removed on the next major - warn user + if (params['device-type'] != null) { + const { deviceTypeArgDeprecation } = await import('../../utils/messages'); + console.log(deviceTypeArgDeprecation('device-type')); + } + const config = await this.buildConfig( params.image, params['device-type'], @@ -74,7 +81,12 @@ export default class OsBuildConfigCmd extends Command { console.info(`Config file "${options.output}" created successfully.`); } - async buildConfig(image: string, deviceTypeSlug: string, advanced: boolean) { + async buildConfig( + image: string, + // TODO: Drop this parameter on the next major + deviceTypeSlug: string | undefined, + advanced: boolean, + ) { advanced = advanced || false; const { getManifest } = await import('../../utils/helpers');