MCPcopy Create free account
hub / github.com/BabylonJS/BabylonReactNative / executeStep

Function executeStep

Package/setup_dev.js:42–65  ·  view source on GitHub ↗

* Execute a command in a specific directory * @param {string} command - The command to execute * @param {string} workingDir - The working directory * @param {string} stepName - Name of the step for logging

(command, workingDir, stepName)

Source from the content-addressed store, hash-verified

40 * @param {string} stepName - Name of the step for logging
41 */
42function executeStep(command, workingDir, stepName) {
43 console.log(`\n🔄 ${stepName}`);
44 console.log(`Working directory: ${workingDir}`);
45 console.log(`Command: ${command}`);
46
47 // Check if directory exists
48 if (!fs.existsSync(workingDir)) {
49 console.error(`❌ Error: Directory ${workingDir} does not exist`);
50 process.exit(1);
51 }
52
53 try {
54 execSync(command, {
55 cwd: workingDir,
56 stdio: 'inherit', // This will show the output in real-time
57 encoding: 'utf8'
58 });
59 console.log(`✅ ${stepName} completed successfully`);
60 } catch (error) {
61 console.error(`❌ ${stepName} failed with error:`);
62 console.error(error.message);
63 process.exit(1);
64 }
65}
66
67async function main() {
68 console.log('Setting up developer environment ...');

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected