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

Fix atomic writestream handling on Windows #8337

Merged
merged 2 commits into from Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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