Skip to content

Commit 4b0ee36

Browse files
srl295rtarsimi
andcommitted
Add path seperator
This avoid permission issues for users that cannot create files in "/", like "/tmpXXXX". It will generate "/tmp/XXX" instead. Ref: #62 d696940 Co-authored-By: Rachid Tarsimi <rtarsimi@users.noreply.github.com>
1 parent a57877d commit 4b0ee36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

myFetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const os = require('os')
44
const path = require('path')
55
const fs = require('fs')
6+
const { sep } = require('path')
67

78
function getFetcher (u) {
89
if (u.protocol === 'https:') return require('https')
@@ -29,7 +30,7 @@ function myFetch (fullUrl) {
2930
} else if (res.statusCode !== 200) {
3031
return reject(Error(`Bad status code ${res.statusCode}`))
3132
}
32-
const tmpd = fs.mkdtempSync(os.tmpdir())
33+
const tmpd = fs.mkdtempSync(`${os.tmpdir()}${sep}`)
3334
const tmpf = path.join(tmpd, 'icu-download.zip')
3435
let gotSoFar = 0
3536
console.dir(tmpd)

0 commit comments

Comments
 (0)