From 49d78c56faa8efaba4005eaf66206ed49e25dd9c Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Thu, 16 Nov 2017 19:47:59 +0100 Subject: [PATCH] Print a deprecation message if you use the old os configure format --- build/actions/os.js | 3 +++ lib/actions/os.coffee | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/build/actions/os.js b/build/actions/os.js index 6a868c76..212e2c11 100644 --- a/build/actions/os.js +++ b/build/actions/os.js @@ -212,6 +212,9 @@ exports.configure = { if (_.filter([options.device, options.application, params.uuid]).length !== 1) { patterns.expectedError('To configure an image, you must provide exactly one of:\n\n* A device, with --device \n* An application, with --app \n* [Deprecated] A device, passing its uuid directly on the command line\n\nSee the help page for examples:\n\n $ resin help os configure'); } + if (params.uuid) { + console.warn('Directly passing a UUID to `resin os configure` is deprecated. Pass it with --uuid instead.' + (params.deviceApiKey ? ' Device api keys can be passed with --deviceApiKey.\n' : '\n')); + } uuid = options.device || params.uuid; deviceApiKey = options.deviceApiKey || params.deviceApiKey; console.info('Configuring operating system image'); diff --git a/lib/actions/os.coffee b/lib/actions/os.coffee index ebb54463..b7c70e49 100644 --- a/lib/actions/os.coffee +++ b/lib/actions/os.coffee @@ -252,6 +252,13 @@ exports.configure = $ resin help os configure ''' + if params.uuid + console.warn( + 'Directly passing a UUID to `resin os configure` is deprecated. Pass it with --uuid instead.' + + if params.deviceApiKey + ' Device api keys can be passed with --deviceApiKey.\n' + else '\n' + ) uuid = options.device || params.uuid deviceApiKey = options.deviceApiKey || params.deviceApiKey