docs: function promisedSpawn(args, options) {
  
      options = options || {};
  
      let promise = new P((resolve, reject) => {
          const argOpts = options.capture ? undefined : { stdio: 'inherit' };
          let ret = '';
          let err = '';
          if (opts.verbose) {
              console.log(`# RUNNING: ${args.join(' ')}\n  (in ${process.cwd()})`);
          }
          child = spawn('/usr/bin/env', args, argOpts);
          if (options.capture) {
              child.stdout.on('data', (data) => {
                  ret += data.toString();
              });
              child.stderr.on('data', (data) => {
                  err += data.toString();
              });
          }
          child.on('close', (code) => {
              child = undefined;
              ret = ret.trim();
              if (ret === '') {
                  ret = undefined;
              }
              if (code) {
                  if (options.ignoreErr) {
                      resolve(ret);
                  } else {
                      reject(new SpawnError(code, err.trim()));
                  }
              } else {
                  resolve(ret);
              }
          });
      });
  
      if (options.useErrHandler || options.errMessage) {
          promise = promise.catch((err) => {
              if (options.errMessage) {
                  console.error(`ERROR: ${options.errMessage.split('\n').join('\nERROR: ')}`);
              }
              let msg = `ERROR: ${args.slice(0, 2).join(' ')} exited with code ${err.code}`;
              if (err.message) {
                  msg += ` and message ${err.message}`;
              }
              console.error(msg);
              process.exit(err.code);
          });
      }
  
      return promise;
  
  }