Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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)
}