mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core&utils: remove outdated code
This commit is contained in:
1 parent
5ae8258b8a
commit
7903d012da
23 files changed
+61
-144
No files matched your search
@@ -23,9 +23,15 @@ function parseParameters(fn: Function) {
|
||||
}
|
||||
|
||||
async function runScript(name: string, arg: any) {
|
||||
if (!global.Hydro.script[name]) return console.error('Script %s not found.', name);
|
||||
validate(global.Hydro.script[name].validate, arg);
|
||||
return await global.Hydro.script[name].run(arg, console.info);
|
||||
const s = global.Hydro.script[name];
|
||||
if (!s) return console.error('Script %s not found.', name);
|
||||
if (typeof s.validate === 'function') {
|
||||
arg = s.validate(arg);
|
||||
} else {
|
||||
console.warn('You are using the legacy script validation API, which will be dropped in the future.');
|
||||
validate(s.validate, arg);
|
||||
}
|
||||
return await s.run(arg, console.info);
|
||||
}
|
||||
|
||||
async function cli() {
|
||||
|
||||
Reference in new issue
Block a user