mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
codeql: remove some useless check
This commit is contained in:
1 parent
8c6f9a3b71
commit
07d7a38a1b
7 files changed
+18
-23
No files matched your search
@@ -135,12 +135,11 @@ process.on('uncaughtException', logger.error);
|
||||
const publicTemp = path.resolve(os.tmpdir(), 'hydro', 'public');
|
||||
|
||||
export function addon(addonPath: string) {
|
||||
let modulePath = path.resolve(process.cwd(), addonPath);
|
||||
if (!(fs.existsSync(addonPath) && fs.statSync(addonPath).isFile())) {
|
||||
try {
|
||||
// Is a npm package
|
||||
const packagejson = require.resolve(`${addonPath}/package.json`);
|
||||
modulePath = path.dirname(packagejson);
|
||||
const modulePath = path.dirname(packagejson);
|
||||
const publicPath = path.resolve(modulePath, 'public');
|
||||
if (fs.existsSync(publicPath)) fs.copySync(publicPath, publicTemp);
|
||||
global.addons.push(modulePath);
|
||||
|
||||
Reference in new issue
Block a user