exec('node -v', function (err, stdout) { if (err) throw err; if (parseFloat(stdout.slice(1)) < 8) { throw new Error('React Slingshot requires node 8.0 or greater.'); } });
function executeCommand(command, args, options = {}) { const child = spawn(command, args, { stdio: 'inherit', ...options }); return new Promise((resolve, reject) => { child.on('close', (code) => { if (code !== 0) { reject(new Error(`${command} ${args.join(' ')} failed with exit code ${code}. Please check your console.`)); return; } resolve(); }); }); }
function isInMercurialRepository() { try { execSync('hg --cwd . root', { stdio: 'ignore' }); return true; } catch (e) { return false; } }
child.stdout.on("data", msg => { msg = msg .toString() .split("\n") .filter(m => { return m.indexOf("already satisfied") === -1; }) .join("\n"); process.stdout.write(msg); });
app.get('/playground/dashboard-app-status', catchErrors(async (req, res) => { this.cubejsServer.event('Dev Server Dashboard App Status'); const dashboardPort = this.dashboardAppProcess && await this.dashboardAppProcess.dashboardUrlPromise; res.json({ running: !!dashboardPort, dashboardPort, dashboardAppPath: path.resolve(dashboardAppPath) }); }));
child.on("close", async () => { var pip = await getPipExe(); if (pip) { console.log("Pip installation completed."); resolve(pip); } else { console.log("Pip installation failed. Please install manually."); } });
function spawnDetached( cwd, command, args, output, env ) { const stdio = output ? [ 'ignore', output, output ] : null; const app = spawn( command, args, { stdio, detached: true, env, cwd } ); app.on( 'error', ( err ) => { throw `failed to initialize command "${ command }": "${ err }"`; } ); return app; }
/** * Initializes git again */ function initGit(callback) { exec('git init && git add . && git commit -m "Initial commit"', callback); }
function isInGitRepository() { try { execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' }); return true; } catch (e) { return false; } }
child.stdout.on("data", msg => { msg = msg .toString() .split("\n") .filter(m => { return m.indexOf("already satisfied") === -1; }) .join("\n"); process.stdout.write(msg); });
function isInMercurialRepository() { try { execSync('hg --cwd . root', { stdio: 'ignore' }); return true; } catch (e) { return false; } }