How to use the execa.shell function in execa

To help you get started, we’ve selected a few execa 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 TryGhost / Ghost-CLI / lib / services / nginx / index.js View on Github external
return this.ui.run(execa.shell(command, {stdio: 'ignore'}), 'Getting SSL certificate').then(() => {
            if (fs.existsSync('/etc/ssl/certs/dhparam.pem')) {
                // Diffie-Hellman cert already exists, skip
                return;
            }

            return this.ui.run(execa.shell('cd /etc/ssl/certs && openssl dhparam -out dhparam.pem 2048'), 'Generating encryption key (hold tight, this may take a while)').catch((error) => {
                return Promise.reject(new errors.ProcessError(error));
            });
        }).then(() => {
            // The SSL config for Ghost uses an `ssl-params` snippet conf taken from https://cipherli.st
github ecrmnn / spaceholder / test / Cli.js View on Github external
before(function (done) {
    execa.shell('node ./index.js -v')
      .then(function (response) {
        result = response.stdout;
        done();
      })
      .catch(function (error) {
        console.log(error);
        done();
      });
  });
github maxlath / wikibase-cli / test / wd-coord.js View on Github external
it('', done => {
    execa.shell('./bin/wd coord Q90')
    .then(res => {
      res.stdout.should.equal('48.856577777778 2.3518277777778')
      done()
    })
    .catch(done)
  })
})
github ecrmnn / spaceholder / test / Cli.js View on Github external
before(function (done) {
    execa.shell('node ./index.js')
      .then(function (response) {
        result = response.stdout;
        done();
      })
      .catch(function (error) {
        console.log(error);
        done();
      });
  });
github bahmutov / next-update / test / command-spec.js View on Github external
function install () {
  return execa.shell('npm install')
}
github bahmutov / next-update / test / command-spec.js View on Github external
function prune () {
  return execa.shell('npm prune')
}
github jondot / hygen-add / src / bin.ts View on Github external
const main = async () => {
  const { red, green, yellow } = chalk
  const args = parser(process.argv.slice(2))
  const [pkg] = args._
  if (!pkg) {
    console.log(help)
    process.exit(1)
  }
  const { name, isUrl } = resolvePackage(pkg, args)
  const spinner = ora(`Adding: ${name}`).start()

  try {
    await execa.shell(
      `${path.join(__dirname, '../node_modules/.bin/')}yarn add --dev ${
        isUrl ? pkg : name
      }`
    )
    const templatePath = path.join('./node_modules', name, '_templates')
    const exists = await fs.pathExists(templatePath)
    await fs.mkdirp('_templates')

    spinner.stop()
    for (const g of await fs.readdir(templatePath)) {
      const maybePrefixed = args.prefix ? `${args.prefix}-${g}` : g
      const wantedTargetPath = tmpl(maybePrefixed)
      const sourcePath = path.join(templatePath, g)

      if (await fs.pathExists(wantedTargetPath)) {
        if (
github prisma / prisma2 / cli / introspection / src / loader.ts View on Github external
async function isYarnInstalled(): Promise {
  try {
    await execa.shell(`yarnpkg --version`, { stdio: `ignore` })
    return true
  } catch (err) {
    return false
  }
}
github Jordaneisenburger / fallback-studio / src / pwa-studio / packages / pwa-buildpack / lib / Utilities / configureHost.js View on Github external
const isSudoSession = () =>
    execa
        .shell('sudo -n true')
        .then(() => true)
        .catch(() => false);
github valor-software / ngm-cli / src / commands / version.command.ts View on Github external
          task: () => execa.shell('git add -A'),
          skip: () => noGitTagVersion