Skip to content

Commit

Permalink
[SecuritySolution][Endpoint] Hoist all function declarations in data …
Browse files Browse the repository at this point in the history
…generator script (#125759)

* Hoist all function declarations

refs /pull/125476

* update alias
  • Loading branch information
ashokaditya authored Feb 16, 2022
1 parent ecefde8 commit 41d5c26
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import { ANCESTRY_LIMIT, EndpointDocGenerator } from '../../common/endpoint/gene

main();

const handleErr = (err: unknown) => {
function handleErr(err: unknown) {
if (err instanceof errors.ResponseError && err.statusCode !== 404) {
console.log(JSON.stringify(err, null, 2));
// eslint-disable-next-line no-process-exit
process.exit(1);
}
};
}

async function deleteIndices(indices: string[], client: Client) {
for (const index of indices) {
Expand Down Expand Up @@ -84,15 +84,15 @@ async function deleteUser(esClient: Client, username: string): Promise<{ found:
});
}

const updateURL = ({
function updateURL({
url,
user,
protocol,
}: {
url: string;
user?: { username: string; password: string };
protocol?: string;
}): string => {
}): string {
const urlObject = new URL(url);
if (user) {
urlObject.username = user.username;
Expand All @@ -102,7 +102,7 @@ const updateURL = ({
urlObject.protocol = protocol;
}
return urlObject.href;
};
}

async function main() {
const argv = yargs.help().options({
Expand Down Expand Up @@ -247,7 +247,7 @@ async function main() {
default: false,
},
withNewUser: {
alias: 'nu',
alias: 'wnu',
describe:
'If the --fleet flag is enabled, using `--withNewUser=username:password` would add a new user with \
the given username, password and `superuser`, `kibana_system` roles. Adding a new user would also write \
Expand Down

0 comments on commit 41d5c26

Please sign in to comment.