Skip to content

Commit

Permalink
main.ts: close/end the FileStreamWriter/WritableStream
Browse files Browse the repository at this point in the history
This should presumably resolve the spawn ETXTBSY error observed.
  • Loading branch information
colemickens committed Oct 23, 2023
1 parent c2e0794 commit 6205da2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ class NixInstallerAction {
const fileStream = node_fs_1.default.createWriteStream(tempfile);
const fileStreamWeb = node_stream_1.default.Writable.toWeb(fileStream);
yield response.body.pipeTo(fileStreamWeb);
yield fileStreamWeb.close();
fileStream.end();
actions_core.info(`Downloaded \`nix-installer\` to \`${tempfile}\``);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ class NixInstallerAction {
const fileStream = fs.createWriteStream(tempfile);
const fileStreamWeb = stream.Writable.toWeb(fileStream);
await response.body.pipeTo(fileStreamWeb);
fileStream.end();

actions_core.info(`Downloaded \`nix-installer\` to \`${tempfile}\``);
} else {
Expand Down

0 comments on commit 6205da2

Please sign in to comment.