mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: optimize template load
This commit is contained in:
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -57,7 +57,7 @@
|
||||
"semver": "^7.6.0",
|
||||
"simple-git": "^3.23.0",
|
||||
"supertest": "^6.3.4",
|
||||
"typescript": "^5.3.3",
|
||||
"typescript": "^5.4.3",
|
||||
"wtfnode": "^0.9.1"
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ import * as misc from './misc';
|
||||
const argv = require('cac')().parse();
|
||||
|
||||
let { template } = argv.options;
|
||||
if (template && typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates');
|
||||
else template &&= findFileSync(template);
|
||||
if (!template || typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates');
|
||||
else template = findFileSync(template);
|
||||
|
||||
class Loader extends nunjucks.Loader {
|
||||
getSource(name) {
|
||||
|
||||
Reference in new issue
Block a user