@@ -32,6 +32,7 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
32
32
33
33
async setup ( { skip_flashing_os : skipFlashingOs , version, load_config : loadConfig , save_config : saveConfig } ) {
34
34
try {
35
+ const loadedFromFile = ! ! loadConfig ;
35
36
this . _showWelcomeMessage ( ) ;
36
37
this . _formatAndDisplaySteps ( "Okay—first up! Checking if you're logged in..." , 1 ) ;
37
38
@@ -98,7 +99,11 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
98
99
const { path : configBlobPath , configBlob } = await this . _runStepWithTiming (
99
100
'Creating the configuration file to write to the Tachyon device...' ,
100
101
6 ,
101
- ( ) => this . _createConfigBlob ( { registrationCode, ...config } )
102
+ ( ) => this . _createConfigBlob ( {
103
+ loadedFromFile,
104
+ registrationCode,
105
+ ...config
106
+ } )
102
107
) ;
103
108
const xmlPath = await this . _createXmlFile ( configBlobPath ) ;
104
109
// Save the config file if requested
@@ -118,7 +123,7 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
118
123
( ) => this . _flash ( {
119
124
files : [ packagePath , xmlPath ] ,
120
125
skipFlashingOs,
121
- silent : ! ! loadConfig
126
+ silent : loadedFromFile
122
127
} )
123
128
) ;
124
129
@@ -405,7 +410,7 @@ Welcome to the Particle Tachyon setup! This interactive command:
405
410
}
406
411
] ;
407
412
const res = await this . ui . prompt ( questions ) ;
408
- const { password } = await this . ui . promptPasswordWithConfirmation ( {
413
+ const password = await this . ui . promptPasswordWithConfirmation ( {
409
414
customMessage : 'Enter your WiFi password:' ,
410
415
customConfirmationMessage : 'Re-enter your WiFi password:'
411
416
} ) ;
@@ -453,11 +458,11 @@ Welcome to the Particle Tachyon setup! This interactive command:
453
458
return data . registration_code ;
454
459
}
455
460
456
- async _createConfigBlob ( { registrationCode, systemPassword, wifi, sshPublicKey, productId } ) {
461
+ async _createConfigBlob ( { loadedFromFile = false , registrationCode, systemPassword, wifi, sshPublicKey, productId } ) {
457
462
// Format the config and registration code into a config blob (JSON file, prefixed by the file size)
458
463
const config = {
459
464
registrationCode : registrationCode ,
460
- systemPassword : this . _generateShadowCompatibleHash ( systemPassword ) ,
465
+ systemPassword : loadedFromFile ? systemPassword : this . _generateShadowCompatibleHash ( systemPassword )
461
466
} ;
462
467
463
468
if ( wifi ) {
0 commit comments