Skip to content

Commit

Permalink
Upgrade standard
Browse files Browse the repository at this point in the history
  • Loading branch information
terales committed Jul 11, 2019
1 parent 7032eed commit badd675
Show file tree
Hide file tree
Showing 8 changed files with 479 additions and 516 deletions.
4 changes: 2 additions & 2 deletions cli/update-all-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ sources.forEach(source => {

samples.files.forEach(sample => {
requests.push(new Promise(resolve => {
let name = path.parse(sample).name
const name = path.parse(sample).name
const targetFile = path.join(samples.dir, name)
const req = request(`http://localhost:8383/${source}/${name}`)
req.on('response', res => {
let ext = '.' + res.headers['content-type'].split('/')[1]
const ext = '.' + res.headers['content-type'].split('/')[1]
req.pipe(fs.createWriteStream(targetFile + ext)).on('finished', () => resolve())
})
}))
Expand Down
Loading

0 comments on commit badd675

Please sign in to comment.