Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
before(function (done) {
execa.shell('node ./index.js -v')
.then(function (response) {
result = response.stdout;
done();
})
.catch(function (error) {
console.log(error);
done();
});
});
it('', done => {
execa.shell('./bin/wd coord Q90')
.then(res => {
res.stdout.should.equal('48.856577777778 2.3518277777778')
done()
})
.catch(done)
})
})
before(function (done) {
execa.shell('node ./index.js')
.then(function (response) {
result = response.stdout;
done();
})
.catch(function (error) {
console.log(error);
done();
});
});
function install () {
return execa.shell('npm install')
}
function prune () {
return execa.shell('npm prune')
}
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 (
async function isYarnInstalled(): Promise {
try {
await execa.shell(`yarnpkg --version`, { stdio: `ignore` })
return true
} catch (err) {
return false
}
}
const isSudoSession = () =>
execa
.shell('sudo -n true')
.then(() => true)
.catch(() => false);
task: () => execa.shell('git add -A'),
skip: () => noGitTagVersion