feat: dev cli (#203)

* feat: adds dev-cli

* feat: adds dev-cli

* fix: works with org package names

* fix: medusa cli bin

* hotfix(brightpearl): rounding errors + failing customer test (#199)

* fix: verdacio publish

* fix: update yarn lock

* fix(CI): update node

* fix: update yarn lock
This commit is contained in:
Sebastian Rindom
2021-03-16 09:51:04 +01:00
committed by GitHub
parent 7c7f86e8e8
commit 695b1fd0a5
24 changed files with 6240 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
const execa = require(`execa`)
const defaultSpawnArgs = {
cwd: process.cwd(),
stdio: `inherit`,
}
exports.setDefaultSpawnStdio = stdio => {
defaultSpawnArgs.stdio = stdio
}
exports.promisifiedSpawn = async ([cmd, args = [], spawnArgs = {}]) => {
const spawnOptions = {
...defaultSpawnArgs,
...spawnArgs,
}
try {
return await execa(cmd, args, spawnOptions)
} catch (e) {
if (spawnOptions.stdio === `ignore`) {
console.log(
`\nCommand "${cmd} ${args.join(
` `
)}" failed.\nTo see details of failed command, rerun "medusa-dev" without "--quiet" or "-q" switch\n`
)
}
throw e
}
}