mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 19:10:14 +02:00
Wait for close event before decompressing tarball
Should reduce the chance of a race condition
This commit is contained in:
parent
50848ee462
commit
2ce9e81d80
@ -11,6 +11,6 @@ environment:
|
|||||||
install:
|
install:
|
||||||
- ps: Install-Product node $env:nodejs_version x64
|
- ps: Install-Product node $env:nodejs_version x64
|
||||||
- npm install -g npm@5.3.x
|
- npm install -g npm@5.3.x
|
||||||
- appveyor-retry npm install
|
- npm install
|
||||||
test_script:
|
test_script:
|
||||||
- npm test
|
- npm test
|
||||||
|
@ -70,7 +70,7 @@ module.exports.download_vips = function () {
|
|||||||
const tarFilename = ['libvips', minimumLibvipsVersion, currentPlatformId].join('-') + '.tar.gz';
|
const tarFilename = ['libvips', minimumLibvipsVersion, currentPlatformId].join('-') + '.tar.gz';
|
||||||
// Download to per-process temporary file
|
// Download to per-process temporary file
|
||||||
const tarPathTemp = path.join(os.tmpdir(), `${process.pid}-${tarFilename}`);
|
const tarPathTemp = path.join(os.tmpdir(), `${process.pid}-${tarFilename}`);
|
||||||
const tmpFile = fs.createWriteStream(tarPathTemp).on('finish', function () {
|
const tmpFile = fs.createWriteStream(tarPathTemp).on('close', function () {
|
||||||
unpack(tarPathTemp, function () {
|
unpack(tarPathTemp, function () {
|
||||||
// Attempt to remove temporary file
|
// Attempt to remove temporary file
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user