import childProcess from 'child_process'

export {default as arg} from 'arg'

export * from 'kleur/colors'

export const spawn = (strs, ...quoted) =>
  new Promise((resolve) => {
    const args = []

    for (let i = 0; i < strs.length; i++) {
      args.push(...strs[i].split(' '))

      if (quoted[i] != null) {
        args.push(quoted[i])
      }
    }

    const spawned = childProcess.spawn(args[0], args.slice(1), {
      stdio: 'inherit'
    })

    spawned.on('exit', () => {
      resolve()
    })
  })

@@ -33,16 +33,40 @@
 process'
+%0Aimport path from 'path'
 %0A%0Aexport
@@ -376,16 +376,196 @@
 %0A    %7D%0A%0A
+    const env = Object.assign(%7B%7D, process.env, %7B%0A      PATH: %60$%7Bprocess.env.PATH%7D$%7Bpath.delimiter%7D$%7Bpath.join(%0A        process.cwd(),%0A        'node_modules/.bin'%0A      )%7D%60%0A    %7D)%0A%0A
     cons
@@ -643,16 +643,53 @@
 inherit'
+,%0A      cwd: process.cwd(),%0A      env
 %0A    %7D)%0A

Improve spawn