From 9ec94fe4fd3cbe5f17a6924b9d2aae22fe1ec178 Mon Sep 17 00:00:00 2001 From: keeramis Date: Tue, 7 Jan 2025 09:05:11 -0800 Subject: [PATCH] Do not provision devices with existing valid profiles --- src/cmd/esim.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/esim.js b/src/cmd/esim.js index b9a61f2f0..92ce05879 100644 --- a/src/cmd/esim.js +++ b/src/cmd/esim.js @@ -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') { @@ -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) {