Merge remote-tracking branch 'origin/master' into skynet-js-3.0.0
This commit is contained in:
commit
7fb60bc042
|
@ -1,6 +1,6 @@
|
|||
const fs = require("fs");
|
||||
const superagent = require("superagent");
|
||||
const tmp = require('tmp');
|
||||
const tmp = require("tmp");
|
||||
const { StatusCodes } = require("http-status-codes");
|
||||
const { calculateElapsedTime, getResponseContent } = require("../utils");
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
require('yargs/yargs')(process.argv.slice(2))
|
||||
.command('$0 <type>', 'Skynet portal health checks', (yargs) => {
|
||||
yargs.positional('type', {
|
||||
describe: 'Type of checks to run',
|
||||
type: 'string',
|
||||
choices: ["critical", "verbose"]
|
||||
require("yargs/yargs")(process.argv.slice(2)).command(
|
||||
"$0 <type>",
|
||||
"Skynet portal health checks",
|
||||
(yargs) => {
|
||||
yargs
|
||||
.positional("type", {
|
||||
describe: "Type of checks to run",
|
||||
type: "string",
|
||||
choices: ["critical", "verbose"],
|
||||
})
|
||||
.option("portal-url", {
|
||||
describe: "Skynet portal url",
|
||||
|
@ -14,8 +17,9 @@ require('yargs/yargs')(process.argv.slice(2))
|
|||
describe: "State directory",
|
||||
default: process.env.STATE_DIR || "state",
|
||||
type: "string",
|
||||
})
|
||||
}, async ({ type, portalUrl, stateDir }) => {
|
||||
});
|
||||
},
|
||||
async ({ type, portalUrl, stateDir }) => {
|
||||
process.env.PORTAL_URL = portalUrl;
|
||||
process.env.STATE_DIR = stateDir;
|
||||
|
||||
|
@ -29,5 +33,5 @@ require('yargs/yargs')(process.argv.slice(2))
|
|||
|
||||
// read before writing to make sure no external changes are overwritten
|
||||
db.read().get(type).push(entry).write();
|
||||
})
|
||||
.argv
|
||||
}
|
||||
).argv;
|
||||
|
|
Reference in New Issue