Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always build HTTPSE with the latest rulesets, fix #7 #12

Merged
merged 3 commits into from Jan 23, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Update preloadHTTPSE.js

  • Loading branch information
cschanaj committed Jan 15, 2019
commit 97059ee59d3705d9d79924e09be381e062a6d792
@@ -23,15 +23,15 @@ const downloadRulesets = (dir, cb) => {
let target = `default.rulesets.${Number(timestamp)}.gz`

https.get(baseURL + target, (stream) => {
// default.rulesets.${timestamp}.gz is gzipped, gunzip accordingly
// ${target} is gzipped, gunzip accordingly
// and pipe the output to ${filename}
let filename = path.join(dir, 'default.rulesets')
let zip = fs.createWriteStream(filename)
let output = fs.createWriteStream(filename)

stream.pipe(zlib.createGunzip()).pipe(zip)
stream.pipe(zlib.createGunzip()).pipe(output)

zip.on('finish', () => {
zip.close(() => {
output.on('finish', () => {
output.close(() => {
// everything is fine here
cb()
}, (err) => {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.