Skip to content

Commit

Permalink
refactor: Replace fse.createWriteStream with fs.createWriteStream
Browse files Browse the repository at this point in the history
  • Loading branch information
sdas13 committed Jul 2, 2021
1 parent 01f1586 commit 12e2e94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/eventuallyUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const os = require('os');
const stream = require('stream');
const { promisify } = require('util');
const fse = require('fs-extra');
const fs = require('fs');
const fsp = require('fs').promises;
const spawn = require('child-process-ext/spawn');
const got = require('got');
Expand Down Expand Up @@ -73,7 +74,7 @@ const standaloneUpdate = async (serverless, { newVersion, abortHandler }) => {
await fse.remove(tempStandalonePath);
const downloadStream = got.stream(executableUrl);
abortHandler.task = () => downloadStream.destroy();
await pipeline(downloadStream, fse.createWriteStream(tempStandalonePath));
await pipeline(downloadStream, fs.createWriteStream(tempStandalonePath));
await fsp.chmod(tempStandalonePath, 0o755);
return () => fsp.rename(tempStandalonePath, standaloneUtils.path);
} catch (error) {
Expand Down

0 comments on commit 12e2e94

Please sign in to comment.