Skip to content

Commit

Permalink
Do not provision devices with existing valid profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Jan 7, 2025
1 parent c122594 commit 9ec94fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cmd/esim.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ module.exports = class ESimCommands extends CLICommandBase {
// Download each profile and update the JSON output
await this._changeLed(device, PROVISIONING_PROGRESS);

// provisionOutputLogs.push(`${os.EOL}Downloading profiles...`);
provisionOutputLogs.push(`${os.EOL}Downloading profiles...`);
const downloadResp = await this._doDownload(profilesToDownload, port);
provisionOutputLogs.push(downloadResp);
if (downloadResp.status === 'failed') {
Expand Down Expand Up @@ -474,13 +474,14 @@ module.exports = class ESimCommands extends CLICommandBase {

try {
logAndPush(`${os.EOL}Checking for existing profiles...`);
const existingProfiles = await this._listProfiles(port);
existingProfiles = await this._listProfiles(port);

if (existingProfiles.length > 0) {
logAndPush(`${os.EOL}Existing profiles found on the device:`);
existingProfiles.forEach((profile) => logAndPush(`\t${profile}`));
} else {
logAndPush(`${os.EOL}No existing profiles found on the device`);
}
logAndPush(`${os.EOL}No existing profiles found on the device`);
status = 'success';
return stepOutput();
} catch (error) {
Expand Down

0 comments on commit 9ec94fe

Please sign in to comment.