Skip to content

Commit

Permalink
fix: avoid chmod on read stream close (#2096)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung authored and thymikee committed Nov 6, 2023
1 parent 3c981e7 commit 67fdaa1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/cli/src/tools/copyFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function copyBinaryFile(
let cbCalled = false;
const {mode} = fs.statSync(srcPath);
const readStream = fs.createReadStream(srcPath);
const writeStream = fs.createWriteStream(destPath);
const writeStream = fs.createWriteStream(destPath, {mode});
readStream.on('error', (err) => {
done(err);
});
Expand All @@ -78,7 +78,6 @@ function copyBinaryFile(
});
readStream.on('close', () => {
done();
fs.chmodSync(destPath, mode);
});
readStream.pipe(writeStream);
function done(err?: Error) {
Expand Down

0 comments on commit 67fdaa1

Please sign in to comment.