How to use the neo-async.forEachSeries function in neo-async

To help you get started, we’ve selected a few neo-async 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 lambci / lambci / actions / build.js View on Github external
// Bit awkward, but we don't want the token written to disk anywhere
  if (build.isPrivate && build.token && !build.config.inheritSecrets) {
    cloneCmd = [
      `mkdir -p ${build.cloneDir}`,
      `cd ${build.cloneDir} && git init && git pull ${depth} ${cloneUrl} ${build.checkoutBranch}`,
    ]
  }

  // No caching of clones for now – can revisit this if we want to – but for now, safer to save space
  var cmds = [`rm -rf ${config.BASE_BUILD_DIR}`].concat(cloneCmd, checkoutCmd)

  var env = prepareLambdaConfig({}).env
  var runCmd = (cmd, cb) => runInBash(cmd, {env: env, logCmd: maskCmd(cmd)}, cb)

  async.forEachSeries(cmds, runCmd, cb)
}