How to use the cross-spawn.spawn.sync function in cross-spawn

To help you get started, we’ve selected a few cross-spawn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TrueCar / gluestick / src / lib / npmDependencies.js View on Github external
function cleanSync () {
  // wipe the existing node_modules folder so we can have a clean start
  rimraf.sync(path.join(process.cwd(), "node_modules"));
  spawn.sync("npm", ["cache", "clean"], {stdio: "inherit"});
}
github kiranz / just-api / test / cli / helpers.js View on Github external
function invokeJustAPI (args) {
    args = [path.join(__dirname, '..', '..', 'bin', 'just-api')].concat(args);
    
    return spawn.sync(process.execPath, args, { cwd: path.resolve('./test/cli/src') });
}
github FritzAndFriends / StreamDeckEmulator / bin / run / index.js View on Github external
function handleRun(args) {
  console.log(Chalk.bold(`Running Emulator on ${args.executable} located in ${args.path}`));
  spawn.sync('npm', ['start'], {
    stdio: 'inherit',
    cwd: path.resolve(__dirname, '../../'),
    env: Object.assign(process.env, {
      'BUILD_PATH': args.path,
      'WINEXE_NAME': args.executable,
      'OSXEXE_NAME': args.executable
    }),
  });
}
github TrueCar / gluestick / src / lib / npmDependencies.js View on Github external
function install () {
  if (which("yarn") !== null) {
    spawn.sync("yarn", {stdio: "inherit"});
  }

  const postFix = IS_WINDOWS ? ".cmd" : "";
  spawn.sync("npm" + postFix, ["install"], {stdio: "inherit"});
}
github TrueCar / gluestick / src / lib / npmDependencies.js View on Github external
function install () {
  if (which("yarn") !== null) {
    spawn.sync("yarn", {stdio: "inherit"});
  }

  const postFix = IS_WINDOWS ? ".cmd" : "";
  spawn.sync("npm" + postFix, ["install"], {stdio: "inherit"});
}
github TrueCar / gluestick / packages / gluestick / docker / create-base-image.js View on Github external
#!/usr/bin/env node

const spawn = require('cross-spawn').spawn;
const fs = require('fs');

const version = JSON.parse(fs.readFileSync('./package.json')).version;
const tag = `truecar/gluestick:${version}`;

spawn.sync('docker', ['build', '-f', './docker/Dockerfile', '--force-rm=true', '-t', tag, '--build-arg', `GLUESTICK_VERSION=${version}`, '.'], { stdio: 'inherit', env: Object.assign({}, process.env) });
spawn.sync('docker', ['push', tag], { stdio: 'inherit', env: Object.assign({}, process.env) });