Skip to content

Commit

Permalink
Fix capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Aug 21, 2024
1 parent d8d6071 commit 2817a21
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/cmd/device-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) => {
Expand All @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/flash-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
8 changes: 4 additions & 4 deletions test/e2e/device-protection.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const {

describe('Device Protection Commands [@device,@device-protection]', () => {
const help = [
'Manage device protection',
'Manage Device Protection',
'Usage: particle device-protection <command>',
'Help: particle help device-protection <command>',
'',
'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]',
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/help.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2817a21

Please sign in to comment.