Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
helpers.log()
process.exit(1)
// console.log(rsp.statusCode)
}
})
// Read Project
var project = fsReader({ 'path': req.project, ignoreFiles: [".surgeignore"] })
// we always ignore .git directory
project.addIgnoreRules(ignore)
// chain all this together...
project
.pipe(tar.Pack())
.pipe(zlib.Gzip())
.pipe(handshake)
}
module.exports = function(req, next){
var pack = tar.Pack()
var zip = zlib.Gzip()
var project = fsReader({ 'path': req.project, ignoreFiles: [".surgeignore"] })
project.addIgnoreRules(ignore)
req.tarballPath = path.resolve("/tmp/", Math.random().toString().split(".")[1] + ".tar")
var tarball = fs.createWriteStream(req.tarballPath)
tarball.on("finish", function(e){
next()
})
project.pipe(pack).pipe(zip).pipe(tarball)
}