Skip to content

Commit

Permalink
Fix atomic writestream handling on Windows (#8337)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Jul 26, 2022
1 parent 62f64ca commit 411d4c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/fs/src/NodeFS.js
Expand Up @@ -14,7 +14,7 @@ import nativeFS from 'fs';
import ncp from 'ncp';
import {promisify} from 'util';
import {registerSerializableClass} from '@parcel/core';
import {hashStream} from '@parcel/utils';
import {hashFile} from '@parcel/utils';
import watcher from '@parcel/watcher';
import packageJSON from '../package.json';

Expand Down Expand Up @@ -77,11 +77,11 @@ export class NodeFS implements FileSystem {
e.code === 'EPERM'
) {
let [hashTmp, hashTarget] = await Promise.all([
hashStream(writeStream.__atomicTmp),
hashStream(writeStream.__atomicTarget),
hashFile(this, tmpFilePath),
hashFile(this, filePath),
]);

await this.unlink(writeStream.__atomicTmp);
await this.unlink(tmpFilePath);

if (hashTmp != hashTarget) {
throw e;
Expand Down

0 comments on commit 411d4c2

Please sign in to comment.