@@ -26,7 +26,7 @@ module.exports = class ESimCommands extends CLICommandBase {
26
26
this . lpa = null ;
27
27
this . inputJson = null ;
28
28
this . inputJsonData = null ;
29
- this . outputJson = null ;
29
+ this . outputFolder = null ;
30
30
this . downloadedProfiles = [ ] ;
31
31
this . binaries = null ;
32
32
this . verbose = false ;
@@ -47,7 +47,8 @@ module.exports = class ESimCommands extends CLICommandBase {
47
47
const device = devices [ 0 ] ;
48
48
const resp = await this . doProvision ( device ) ;
49
49
await this . _changeLed ( device , resp . success ? PROVISIONING_SUCCESS : PROVISIONING_FAILURE ) ;
50
- this . _addToJson ( this . outputJson , resp ) ;
50
+ const outputJsonForDevice = path . join ( this . outputFolder , `${ device . deviceId } .json` ) ;
51
+ this . _addToJson ( outputJsonForDevice , resp ) ;
51
52
}
52
53
53
54
async bulkProvisionCommand ( args ) {
@@ -61,9 +62,10 @@ module.exports = class ESimCommands extends CLICommandBase {
61
62
const deviceId = device . deviceId ;
62
63
provisionedDevices . add ( deviceId ) ;
63
64
console . log ( `Device ${ deviceId } connected` ) ;
64
- const resp = await this . doProvision ( device , { verbose : true } ) ;
65
+ const outputJsonForDevice = path . join ( this . outputFolder , `${ deviceId } .json` ) ;
66
+ const resp = await this . doProvision ( device , { verbose : false } ) ;
65
67
await this . _changeLed ( device , resp . success ? PROVISIONING_SUCCESS : PROVISIONING_FAILURE ) ;
66
- this . _addToJson ( this . outputJson , resp ) ;
68
+ this . _addToJson ( outputJsonForDevice , resp ) ;
67
69
}
68
70
}
69
71
} , 1000 ) ;
@@ -232,7 +234,7 @@ module.exports = class ESimCommands extends CLICommandBase {
232
234
const input = fs . readFileSync ( this . inputJson ) ;
233
235
this . inputJsonData = JSON . parse ( input ) ;
234
236
235
- this . outputJson = args . output ;
237
+ this . outputFolder = args . output ;
236
238
this . lpa = args . lpa ;
237
239
this . binaries = args . binary ;
238
240
}
0 commit comments