MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / checkFile

Function checkFile

scripts/quality-check.js:63–78  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

61
62// 辅助函数
63function checkFile(filePath) {
64 const fullPath = path.join(projectRoot, filePath);
65 if (!fs.existsSync(fullPath)) {
66 BuildLogger.error(`文件不存在: ${filePath}`);
67 return false;
68 }
69
70 try {
71 execSync(`node -c "${fullPath}"`, { stdio: 'pipe' });
72 return true;
73 } catch (error) {
74 BuildLogger.error(`语法错误: ${filePath}`);
75 BuildLogger.error(error.message);
76 return false;
77 }
78}
79
80function checkEnvExample() {
81 const envPath = path.join(projectRoot, 'env.example');

Callers 1

runChecksFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected