codeql: remove some useless check

This commit is contained in:
undefined committed 2021-02-28 14:43:53 +08:00
1 parent 8c6f9a3b71
commit 07d7a38a1b
7 files changed
+18 -23

No files matched your search

+1 -2
View File
@@ -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);