deploy-finlean
Advanced tools
+16
-5
@@ -5,3 +5,3 @@ /* | ||
| * @LastEditors: zhaoxiaoqiang1 287285524@qq.com | ||
| * @LastEditTime: 2026-03-20 16:06:16 | ||
| * @LastEditTime: 2026-03-20 16:12:19 | ||
| * @FilePath: \deploy-package\index.js | ||
@@ -30,6 +30,17 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||
| // 将Windows路径转换为file:// URL | ||
| const configUrl = `file://${configPath.replace(/\\/g, '/')}`; | ||
| const configModule = await import(configUrl); | ||
| const config = configModule.default; | ||
| // 读取配置文件内容 | ||
| const configContent = fs.readFileSync(configPath, 'utf8'); | ||
| // 移除可能的BOM字符 | ||
| const cleanContent = configContent.replace(/^\ufeff/, ''); | ||
| // 解析配置文件 | ||
| let config; | ||
| try { | ||
| // 尝试使用ES模块语法解析 | ||
| const moduleCode = `(function() { ${cleanContent.replace('export default', 'return')} })()`; | ||
| config = eval(moduleCode); | ||
| } catch (error) { | ||
| console.error('Error parsing config file:', error); | ||
| process.exit(1); | ||
| } | ||
| console.log('配置文件读取完成'); | ||
@@ -36,0 +47,0 @@ |
+1
-1
| { | ||
| "name": "deploy-finlean", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4", | ||
| "description": "Deployment package for projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
11210
3.02%184
5.75%2
100%