@@ -12,7 +12,6 @@ const path = require('path');
12
12
const _ = require ( 'lodash' ) ;
13
13
14
14
// TODO: Get these from exports
15
- const PATH_TO_PASS_THROUGH_BINARIES = '/Users/keerthyamisagadda/code/kigen-resources/binaries' ;
16
15
const PROVISIONING_PROGRESS = 1 ;
17
16
const PROVISIONING_SUCCESS = 2 ;
18
17
const PROVISIONING_FAILURE = 3 ;
@@ -30,6 +29,7 @@ module.exports = class eSimCommands extends CLICommandBase {
30
29
this . inputJsonData = null ;
31
30
this . outputJson = null ;
32
31
this . downloadedProfiles = [ ] ;
32
+ this . binaries = null ;
33
33
this . verbose = false ;
34
34
}
35
35
@@ -277,12 +277,16 @@ module.exports = class eSimCommands extends CLICommandBase {
277
277
if ( ! args . lpa ) {
278
278
throw new Error ( 'Missing input LPA tool path' ) ;
279
279
}
280
+ if ( ! args . binary ) {
281
+ throw new Error ( 'Missing folder path to binaries' ) ;
282
+ }
280
283
this . inputJson = args . input ;
281
284
const input = fs . readFileSync ( this . inputJson ) ;
282
285
this . inputJsonData = JSON . parse ( input ) ;
283
286
284
287
this . outputJson = args . output ;
285
288
this . lpa = args . lpa ;
289
+ this . binaries = args . binary ;
286
290
}
287
291
288
292
async _flashATPassThroughFirmware ( device , platform ) {
@@ -300,15 +304,15 @@ module.exports = class eSimCommands extends CLICommandBase {
300
304
try {
301
305
// Locate the firmware binary
302
306
logAndPush ( `${ os . EOL } Locating firmware for platform: ${ platform } ` ) ;
303
- const fwBinaries = fs . readdirSync ( PATH_TO_PASS_THROUGH_BINARIES ) ;
307
+ const fwBinaries = fs . readdirSync ( this . binaries ) ;
304
308
const validBin = fwBinaries . find ( ( file ) => file . endsWith ( `${ platform } .bin` ) ) ;
305
309
306
310
if ( ! validBin ) {
307
311
logAndPush ( `No firmware binary found for platform: ${ platform } ` ) ;
308
312
return { success : false , output : outputLogs } ;
309
313
}
310
314
311
- const fwPath = path . join ( PATH_TO_PASS_THROUGH_BINARIES , validBin ) ;
315
+ const fwPath = path . join ( this . binaries , validBin ) ;
312
316
logAndPush ( `${ os . EOL } Found firmware: ${ fwPath } ` ) ;
313
317
314
318
// Flash the binary
0 commit comments