Skip to content

Commit e720722

Browse files
Update console URL in tachyon flash step for staging config
1 parent 35cf179 commit e720722

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

settings.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const _ = require('lodash');
55

66
let settings = {
77
apiUrl: 'https://api.particle.io',
8+
get isStaging() {
9+
return this.apiUrl.includes('staging');
10+
},
811
clientId: 'CLI2',
912
access_token: null,
1013
username: null,

src/cmd/setup-tachyon.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
8181
config.variant = await this._pickVariantStep(config); // step 4
8282
}
8383

84-
const isStaging = settings.apiUrl.includes('staging');
8584
config.apiServer = settings.apiUrl;
86-
config.server = isStaging ? 'https://host-connect.staging.particle.io': 'https://host-connect.particle.io';
87-
config.verbose = isStaging; // Extra logging if connected to staging
85+
config.server = settings.isStaging ? 'https://host-connect.staging.particle.io': 'https://host-connect.particle.io';
86+
config.verbose = settings.isStaging; // Extra logging if connected to staging
8887

8988
config.packagePath = await this._downloadStep(config); // step 5
9089
config.registrationCode = await this._registerDeviceStep(config); // step 6
@@ -334,6 +333,7 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
334333
async _finalStep(flashSuccessful, config) { // TODO (hmontero): once we have the device in the cloud, we should show the device id
335334
if (flashSuccessful) {
336335
const { product } = await this.api.getProduct({ product: config.productId });
336+
const consoleUrl = `https://console${settings.isStaging ? '.staging' : ''}.particle.io`
337337
if (config.variant === 'desktop') {
338338
this._formatAndDisplaySteps(
339339
`All done! Your Tachyon device is ready to boot to the desktop and will automatically connect to Wi-Fi.${os.EOL}${os.EOL}` +
@@ -348,7 +348,7 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
348348
` - Run all system services, including the desktop if an HDMI monitor is connected.${os.EOL}${os.EOL}` +
349349
`For more information about Tachyon, visit our developer site at: https://developer.particle.io!${os.EOL}` +
350350
`${os.EOL}` +
351-
`View your device on the Particle Console at: https://console.particle.io/${product.slug}${os.EOL}`,
351+
`View your device on the Particle Console at: ${consoleUrl}/${product.slug}${os.EOL}`,
352352
9
353353
);
354354
} else {
@@ -360,7 +360,7 @@ module.exports = class SetupTachyonCommands extends CLICommandBase {
360360
` - Run all system services, including battery charging${os.EOL}${os.EOL}` +
361361
`For more information about Tachyon, visit our developer site at: https://developer.particle.io!${os.EOL}` +
362362
`${os.EOL}` +
363-
`View your device on the Particle Console at: https://console.particle.io/${product.slug}${os.EOL}`,
363+
`View your device on the Particle Console at: ${consoleUrl}/${product.slug}${os.EOL}`,
364364
9
365365
);
366366
}

0 commit comments

Comments
 (0)