Skip to content

Commit

Permalink
Fix end of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Jun 17, 2024
1 parent b25d7c9 commit a8c7b4a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/cmd/device-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
s = await this.device.getProtectionState();
} catch (error) {
if (error.message === 'Not supported') {
throw new Error(`Device protection feature is not supported on this device${os.EOL}${os.EOL}`);
throw new Error(`Device protection feature is not supported on this device${os.EOL}`);
}
}

Expand All @@ -46,10 +46,10 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
} else if (s.protected && !s.overridden) {
res = 'Protected';
} else if (s.overridden) {
res = 'Protected (service mode)';
res = `Protected (service mode)${os.EOL}Device is put into service mode for a total of 20 reboots or 24 hours.`;
}

this.ui.stdout.write(`Device protection: ${res}${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device protection: ${res}${os.EOL}`);

return s;
});
Expand All @@ -62,11 +62,11 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
s = await this.device.getProtectionState();
} catch (error) {
if (error.message === 'Not supported') {
throw new Error(`Device protection feature is not supported on this device${os.EOL}${os.EOL}`);
throw new Error(`Device protection feature is not supported on this device${os.EOL}`);
}
}
if (!s.protected && !s.overridden) {
this.ui.stdout.write(`Device is not protected${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device is not protected${os.EOL}`);
return;
}

Expand Down Expand Up @@ -106,7 +106,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {

s = await this.device.getProtectionState();
if (!open) {
this.ui.stdout.write(`Device protection temporarily disabled.${os.EOL}Device is put into service mode for 20 reboots or 24 hours.${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device protection temporarily disabled.${os.EOL}Device is put into service mode for 20 reboots or 24 hours.${os.EOL}`);
return;
}

Expand All @@ -118,12 +118,12 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {

this.ui.stdout.write(os.EOL);

this.ui.stdout.write(`Device protection disabled.${os.EOL}Device is open${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device protection disabled.${os.EOL}Device is open${os.EOL}`);

const success = await this._markAsDevelopmentDevice(true);

if (!success) {
this.ui.stdout.write(`Failed to mark device as development device. Protection will be automatically enabled after a power cycle${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Failed to mark device as development device. Protection will be automatically enabled after a power cycle${os.EOL}`);
}
}
});
Expand Down Expand Up @@ -161,7 +161,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
s = await this.device.getProtectionState();
} catch (error) {
if (error.message === 'Not supported') {
throw new Error(`Device protection feature is not supported on this device${os.EOL}${os.EOL}`);
throw new Error(`Device protection feature is not supported on this device${os.EOL}`);
}
}

Expand All @@ -174,17 +174,17 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
}

if (s.protected && !s.overridden) {
this.ui.stdout.write(`Device is protected${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device is protected${os.EOL}`);
return;
}

if (s.overridden) {
// terminate unlock
await this.device.unprotectDevice({ action: 'reset' });
this.ui.stdout.write(`Device is protected${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Device is protected${os.EOL}`);
const success = await this._markAsDevelopmentDevice(false);
if (!success) {
this.ui.stdout.write(`Failed to remove device from development mode. Ensure it is not in development mode for protection to work properly.${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Failed to remove device from development mode. Ensure it is not in development mode for protection to work properly.${os.EOL}`);
}
return;
}
Expand All @@ -201,11 +201,11 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
const success = await this._markAsDevelopmentDevice(false);

if (!success) {
this.ui.stdout.write(`Failed to remove device from development mode. Ensure it is not in development mode for protection to work properly.${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Failed to remove device from development mode. Ensure it is not in development mode for protection to work properly.${os.EOL}`);
}
}

this.ui.write(`${os.EOL}Device is protected${os.EOL}${os.EOL}`);
this.ui.write(`${os.EOL}Device is protected${os.EOL}`);
});
}

Expand Down Expand Up @@ -255,7 +255,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
if (this.device.isInDfuMode) {
this.ui.stdout.write(`Device is in DFU mode. Performing a reset to get the device in normal mode. Please wait...${os.EOL}`);
await this.resetDevice(this.device);
this.ui.stdout.write(`Done! Device is now in normal mode.${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Done! Device is now in normal mode.${os.EOL}`);
await this.getUsbDevice(this.device);
}

Expand Down Expand Up @@ -297,7 +297,7 @@ module.exports = class DeviceProtectionCommands extends CLICommandBase {
await fs.writeFile(resBinaryPath, protectedBinary);

if (verbose) {
this.ui.stdout.write(`Protected binary saved at ${resBinaryPath}${os.EOL}${os.EOL}`);
this.ui.stdout.write(`Protected binary saved at ${resBinaryPath}${os.EOL}`);
}

return resBinaryPath;
Expand Down

0 comments on commit a8c7b4a

Please sign in to comment.