MCPcopy Index your code
hub / github.com/hydro-dev/Hydro / runScript

Function runScript

packages/hydrooj/src/entry/cli.ts:30–35  ·  view source on GitHub ↗
(name: string, arg: any)

Source from the content-addressed store, hash-verified

28}
29
30async function runScript(name: string, arg: any) {
31 const s = global.Hydro.script[name];
32 if (!s) return console.error('Script %s not found.', name);
33 if (typeof s.validate === 'function') arg = s.validate(arg);
34 return await s.run(arg, console.info);
35}
36
37function checkStringArray(args: ParseEntry[]): args is string[] {
38 return args.every((arg) => typeof arg === 'string');

Callers 1

cliFunction · 0.85

Calls 2

runMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected