mirror of
https://gitea.com/actions/gitea-release-action.git
synced 2026-03-24 21:58:23 +00:00
fix: autoclose stream
This commit is contained in:
16
dist/index.js
vendored
16
dist/index.js
vendored
@@ -48266,17 +48266,17 @@ function paths(patterns) {
|
||||
};
|
||||
|
||||
async function createStreamableFile(fpath) {
|
||||
const name = external_path_.basename(fpath);
|
||||
const handle = await promises_namespaceObject.open(fpath);
|
||||
const { size } = await handle.stat();
|
||||
const name = external_path_.basename(fpath);
|
||||
const handle = await promises_namespaceObject.open(fpath);
|
||||
const { size } = await handle.stat();
|
||||
|
||||
const file = new external_buffer_.File([], name);
|
||||
file.stream = () => handle.readableWebStream();
|
||||
const file = new external_buffer_.File([], name);
|
||||
file.stream = () => handle.readableWebStream({autoClose: true});
|
||||
|
||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||
Object.defineProperty(file, 'size', { get: () => size });
|
||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||
Object.defineProperty(file, 'size', { get: () => size });
|
||||
|
||||
return file;
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
|
||||
16
main.js
16
main.js
@@ -128,17 +128,17 @@ function paths(patterns) {
|
||||
};
|
||||
|
||||
async function createStreamableFile(fpath) {
|
||||
const name = path.basename(fpath);
|
||||
const handle = await asyncfs.open(fpath);
|
||||
const { size } = await handle.stat();
|
||||
const name = path.basename(fpath);
|
||||
const handle = await asyncfs.open(fpath);
|
||||
const { size } = await handle.stat();
|
||||
|
||||
const file = new File([], name);
|
||||
file.stream = () => handle.readableWebStream();
|
||||
const file = new File([], name);
|
||||
file.stream = () => handle.readableWebStream({autoClose: true});
|
||||
|
||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||
Object.defineProperty(file, 'size', { get: () => size });
|
||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||
Object.defineProperty(file, 'size', { get: () => size });
|
||||
|
||||
return file;
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user