drgame-cc 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/postinstall.js +1 -21
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -12,27 +12,7 @@ const projectRoot = path.resolve(__dirname, '..', '..');
|
|
|
12
12
|
// ============================================================
|
|
13
13
|
// 2. 加载宿主项目根目录下的 .env
|
|
14
14
|
// ============================================================
|
|
15
|
-
|
|
16
|
-
const envPath = path.join(projectRoot, '.env');
|
|
17
|
-
if (fs.existsSync(envPath)) {
|
|
18
|
-
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
19
|
-
envContent.split('\n').forEach(line => {
|
|
20
|
-
const trimmedLine = line.trim();
|
|
21
|
-
if (trimmedLine && !trimmedLine.startsWith('#')) {
|
|
22
|
-
const [key, ...valueParts] = trimmedLine.split('=');
|
|
23
|
-
if (key && valueParts.length > 0) {
|
|
24
|
-
const value = valueParts.join('=').trim();
|
|
25
|
-
if (!process.env[key]) {
|
|
26
|
-
process.env[key] = value.replace(/^["']|["']$/g, '');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
console.log('✅ 已加载 .env');
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
loadEnvFile();
|
|
15
|
+
console.log('✅ 开始拷贝资源');
|
|
36
16
|
|
|
37
17
|
// ============================================================
|
|
38
18
|
// 3. 确定目标目录
|