From 2817a210ef656c534ca09fc5c6dc6d19a6cb2a0b Mon Sep 17 00:00:00 2001 From: keeramis Date: Thu, 15 Aug 2024 13:44:06 -0700 Subject: [PATCH] Fix capitalization --- src/cmd/device-protection.js | 8 ++++---- src/cmd/keys.js | 4 ++-- src/lib/flash-helper.js | 4 ++-- src/lib/utilities.js | 2 +- test/README.md | 4 ++-- test/e2e/device-protection.e2e.js | 8 ++++---- test/e2e/help.e2e.js | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cmd/device-protection.js b/src/cmd/device-protection.js index 6d0d6593c..6e17db1ba 100644 --- a/src/cmd/device-protection.js +++ b/src/cmd/device-protection.js @@ -90,7 +90,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase { async disableProtection() { let addToOutput = []; try { - await this._withDevice({ spinner: 'Disabling device protection' }, async () => { + await this._withDevice({ spinner: 'Disabling Device Protection' }, async () => { const deviceStr = await this._getDeviceString(); const s = this.status; @@ -110,7 +110,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase { if (error.message === 'Not supported') { throw new Error(`Device Protection feature is not supported on this device. Visit ${chalk.yellow('https://docs.particle.io')} for more information${os.EOL}`); } - throw new Error(`Failed to disable device protection: ${error.message}${os.EOL}`); + throw new Error(`Failed to disable Device Protection: ${error.message}${os.EOL}`); } addToOutput.forEach((line) => { @@ -135,7 +135,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase { async enableProtection({ file } = {}) { let addToOutput = []; try { - await this._withDevice({ spinner: 'Enabling device protection' }, async () => { + await this._withDevice({ spinner: 'Enabling Device Protection' }, async () => { const deviceStr = await this._getDeviceString(); const s = this.status; @@ -189,7 +189,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase { if (error.message === 'Not supported') { throw new Error(`Device Protection feature is not supported on this device. Visit ${chalk.yellow('https://docs.particle.io')} for more information${os.EOL}`); } - throw new Error(`Failed to enable device protection: ${error.message}${os.EOL}`); + throw new Error(`Failed to enable Device Protection: ${error.message}${os.EOL}`); } addToOutput.forEach((line) => { diff --git a/src/cmd/keys.js b/src/cmd/keys.js index 3266a485e..bcd333500 100644 --- a/src/cmd/keys.js +++ b/src/cmd/keys.js @@ -533,7 +533,7 @@ module.exports = class KeysCommand { await device.writeOverDfu(buffer, { altSetting, startAddr, leave, noErase }); } catch (err) { if (err instanceof DeviceProtectionError) { - throw new Error('Operation could not be completed due to device protection.'); + throw new Error('Operation could not be completed due to Device Protection.'); } throw new VError(ensureError(err), 'Writing over DFU failed'); } @@ -545,7 +545,7 @@ module.exports = class KeysCommand { buf = await device.readOverDfu({ altSetting, startAddr, size }); } catch (err) { if (err instanceof DeviceProtectionError) { - throw new Error('Operation could not be completed due to device protection.'); + throw new Error('Operation could not be completed due to Device Protection.'); } // FIXME: First time read may fail so we retry try { diff --git a/src/lib/flash-helper.js b/src/lib/flash-helper.js index 118180ff0..7f70ce11c 100644 --- a/src/lib/flash-helper.js +++ b/src/lib/flash-helper.js @@ -86,7 +86,7 @@ async function _flashDeviceInNormalMode(device, data, { name, progress, checkSki } catch (error) { // ignore other errors from attempts to flash to external flash if (error instanceof DeviceProtectionError) { - throw new Error('Operation could not be completed due to device protection.'); + throw new Error('Operation could not be completed due to Device Protection.'); } } } @@ -365,7 +365,7 @@ async function maintainDeviceProtection({ modules, device }) { return; } } catch (error) { - // Device does not support device protection -> Don't enforce Device OS version + // Device does not support Device Protection -> Don't enforce Device OS version if (error.message === 'Not supported') { return; } diff --git a/src/lib/utilities.js b/src/lib/utilities.js index fe91a4c7c..01699651c 100644 --- a/src/lib/utilities.js +++ b/src/lib/utilities.js @@ -381,7 +381,7 @@ module.exports = { ensureError(err){ if (err instanceof DeviceProtectionError) { - return new Error('Operation could not be completed due to device protection'); + return new Error('Operation could not be completed due to Device Protection'); } if (!_.isError(err) && !(err instanceof VError)){ diff --git a/test/README.md b/test/README.md index 5c32f08f1..ce099c2bc 100644 --- a/test/README.md +++ b/test/README.md @@ -102,9 +102,9 @@ The e2e tests run in two modes: with a device connected, and without. Since the 1. run `npm run test:e2e:no-device` -### Running device protection tests +### Running Device Protection tests -1. Ensure the device `E2E_PRODUCT_01_DEVICE_01_ID` in product `E2E_PRODUCT_01_ID` is an Open Device in a product with device protection active at the start of the tests. +1. Ensure the device `E2E_PRODUCT_01_DEVICE_01_ID` in product `E2E_PRODUCT_01_ID` is an Open Device in a product with Device Protection active at the start of the tests. 2. Ensure the device is not in DFU mode. 3. run `npm run test:e2e:device-protection` diff --git a/test/e2e/device-protection.e2e.js b/test/e2e/device-protection.e2e.js index e672121a1..d8d416908 100644 --- a/test/e2e/device-protection.e2e.js +++ b/test/e2e/device-protection.e2e.js @@ -7,14 +7,14 @@ const { describe('Device Protection Commands [@device,@device-protection]', () => { const help = [ - 'Manage device protection', + 'Manage Device Protection', 'Usage: particle device-protection ', 'Help: particle help device-protection ', '', 'Commands:', - ' status Gets the current device protection status', - ' disable Disables device protection', - ' enable Enables device protection', + ' status Gets the current Device Protection status', + ' disable Disables Device Protection', + ' enable Enables Device Protection', '', 'Global Options:', ' -v, --verbose Increases how much logging to display [count]', diff --git a/test/e2e/help.e2e.js b/test/e2e/help.e2e.js index 95ca80803..3333abe1f 100644 --- a/test/e2e/help.e2e.js +++ b/test/e2e/help.e2e.js @@ -15,7 +15,7 @@ describe('Help & Unknown Command / Argument Handling', () => { ' compile Compile a source file, or directory using the cloud compiler', ' config Configure and switch between multiple accounts', ' device Manipulate a device', - ' device-protection Manage device protection', + ' device-protection Manage Device Protection', ' doctor NOT SUPPORTED. Go to the device doctor tool at docs.particle.io/tools/doctor', ' flash Send firmware to your device', ' function Call functions on your device',