How to use the @lerna/child-process.spawn function in @lerna/child-process

To help you get started, we’ve selected a few @lerna/child-process 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 lerna / lerna / utils / rimraf-dir / rimraf-dir.js View on Github external
return pathExists(dirPath).then(exists => {
    if (!exists) {
      return;
    }

    // globs only return directories with a trailing slash
    const slashed = path.normalize(`${dirPath}/`);
    const args = [RIMRAF_CLI, "--no-glob", slashed];

    // We call this resolved CLI path in the "path/to/node path/to/cli <..args>"
    // pattern to avoid Windows hangups with shebangs (e.g., WSH can't handle it)
    return ChildProcessUtilities.spawn(process.execPath, args).then(() => {
      log.verbose("rimrafDir", "removed", dirPath);

      return dirPath;
    });
  });
}
github lerna / lerna / utils / rimraf-dir / rimraf-dir.js View on Github external
return pathExists(dirPath).then(exists => {
    if (!exists) {
      return;
    }

    // globs only return directories with a trailing slash
    const slashed = path.normalize(`${dirPath}/`);
    const args = [RIMRAF_CLI, "--no-glob", slashed];

    // We call this resolved CLI path in the "path/to/node path/to/cli <..args>"
    // pattern to avoid Windows hangups with shebangs (e.g., WSH can't handle it)
    return ChildProcessUtilities.spawn(process.execPath, args).then(() => {
      log.verbose("rimrafDir", "removed", dirPath);

      return dirPath;
    });
  });
}
github lerna / lerna / commands / diff / index.js View on Github external
execute() {
    return ChildProcessUtilities.spawn("git", this.args, this.execOpts).catch(err => {
      if (err.code) {
        // quitting the diff viewer is not an error
        throw err;
      }
    });
  }
}
github elastic / apm-agent-rum-js / scripts / benchmarks.js View on Github external
function runBenchmarks() {
  const outputFile = process.argv[2]
  const lernaProcess = spawn('lerna', ['run', 'bench', '--stream'])
  lernaProcess.on('exit', code => {
    if (code !== 0) {
      process.exit(code)
    }
  })
  lernaProcess.on('close', async () => {
    try {
      const results = await getAllBenchmarkResults()
      if (results.length === 0) {
        console.warn('No benchmarks results found', 'Skipping this run')
        process.exit(1)
      }
      const gitlog = execSync('git', [
        'log',
        '-1',
        '--pretty=%h,%s',
github lerna / lerna / commands / exec / index.js View on Github external
runCommandInPackageCapturing(pkg) {
    return ChildProcessUtilities.spawn(this.command, this.args, this.getOpts(pkg));
  }
}

@lerna/child-process

Lerna's internal child_process wrapper

MIT
Latest version published 1 year ago

Package Health Score

84 / 100
Full package analysis