Skip to content

Commit

Permalink
Check if flag is present in output
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnski authored and pepoviola committed Dec 1, 2023
1 parent 326223b commit 5786611
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export const getCliArgsVersion = async (
await client.spawnFromDef(podDef);
const logs = await client.getNodeLogs(podName);

return logs.includes("--ws-port <PORT>")
? SubstrateCliArgsVersion.V0
: SubstrateCliArgsVersion.V2;
if logs.includes("--ws-port <PORT>") {
return SubstrateCliArgsVersion.V0;
} else if !logs.includes("--insecure-validator-i-know-what-i-do") {
return SubstrateCliArgsVersion.V1;
} else {
return SubstrateCliArgsVersion.V2;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export const getCliArgsVersion = async (
const logs = (await client.runCommand(["-c", fullCmd], { allowFail: true }))
.stdout;

return logs.includes("--ws-port <PORT>")
? SubstrateCliArgsVersion.V0
: SubstrateCliArgsVersion.V2;

if logs.includes("--ws-port <PORT>") {
return SubstrateCliArgsVersion.V0;
} else if !logs.includes("--insecure-validator-i-know-what-i-do") {
return SubstrateCliArgsVersion.V1;
} else {
return SubstrateCliArgsVersion.V2;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ export const getCliArgsVersion = async (
await client.spawnFromDef(podDef);
const logs = await client.getNodeLogs(podName);

return logs.includes("--ws-port <PORT>")
? SubstrateCliArgsVersion.V0
: SubstrateCliArgsVersion.V2;

if logs.includes("--ws-port <PORT>") {
return SubstrateCliArgsVersion.V0;
} else if !logs.includes("--insecure-validator-i-know-what-i-do") {
return SubstrateCliArgsVersion.V1;
} else {
return SubstrateCliArgsVersion.V2;
}
};

0 comments on commit 5786611

Please sign in to comment.