Skip to content

Commit

Permalink
diagnostics: print addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Sep 14, 2024
1 parent c96b473 commit 1ffe835
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/diagnostics/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/diagnostics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/diagnostics",
"version": "0.0.10",
"version": "0.0.11",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
"prescrypted-setup-project": "scrypted-package-json",
Expand Down
4 changes: 3 additions & 1 deletion plugins/diagnostics/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings {
}

warnStep(result: string) {
this.console.log(''.padEnd(24), `\x1b[33m ${result}\x1b[0m`);
this.console.log(''.padEnd(24), `\x1b[33m${result}\x1b[0m`);
}

async validate(stepName: string, step: Promise<any> | (() => Promise<any>)) {
Expand Down Expand Up @@ -328,6 +328,8 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings {
const addresses = await sdk.endpointManager.getLocalAddresses();
const hasIPv4 = addresses.find(address => net.isIPv4(address));
const hasIPv6 = addresses.find(address => net.isIPv6(address));
if (addresses.length)
this.warnStep(addresses.join(', '));
if (!hasIPv4)
throw new Error('Scrypted Settings IPv4 address not set.');
if (!hasIPv6)
Expand Down

0 comments on commit 1ffe835

Please sign in to comment.