|
1 | | -const fs = require('fs'); |
2 | | -const path = require('path'); |
3 | | -const { execSync } = require('child_process'); |
| 1 | +const fs = require("fs"); |
| 2 | +const path = require("path"); |
| 3 | +const { execSync, execFileSync } = require("child_process"); |
4 | 4 |
|
5 | 5 | // Configuration file path |
6 | 6 | const CONFIG_FILE = path.join(__dirname, 'build-config.json'); |
@@ -51,19 +51,19 @@ function runBuildScripts() { |
51 | 51 |
|
52 | 52 | console.log(`▶️ Running: ${scriptPath}`); |
53 | 53 |
|
54 | | - try { |
55 | | - if (scriptPath.endsWith('.ts')) { |
56 | | - // For TypeScript files, use ts-node |
57 | | - execSync(`npx ts-node ${fullPath}`, { stdio: 'inherit' }); |
58 | | - } else { |
59 | | - // For JavaScript files, use node |
60 | | - execSync(`node ${fullPath}`, { stdio: 'inherit' }); |
61 | | - } |
62 | | - console.log(`✅ Completed: ${scriptPath}`); |
63 | | - } catch (error) { |
64 | | - console.error(`❌ Error running ${scriptPath}:`, error.message); |
65 | | - } |
66 | | - }); |
| 54 | + try { |
| 55 | + if (scriptPath.endsWith(".ts")) { |
| 56 | + // For TypeScript files, use ts-node |
| 57 | + execFileSync("npx", ["ts-node", fullPath], { stdio: "inherit" }); |
| 58 | + } else { |
| 59 | + // For JavaScript files, use node |
| 60 | + execFileSync("node", [fullPath], { stdio: "inherit" }); |
| 61 | + } |
| 62 | + console.log(`✅ Completed: ${scriptPath}`); |
| 63 | + } catch (error) { |
| 64 | + console.error(`❌ Error running ${scriptPath}:`, error.message); |
| 65 | + } |
| 66 | + }); |
67 | 67 |
|
68 | 68 | console.log('✨ Build scripts completed'); |
69 | 69 | } |
|
0 commit comments