Revert "fix: fix file closing issue (#629)"

This reverts commit 07a2257003.
This commit is contained in:
Rui Chen 2025-06-10 18:22:07 -04:00
parent f3cad8bcbf
commit eaae3e764f
No known key found for this signature in database
GPG key ID: 6577287BDCA70840
3 changed files with 4 additions and 8 deletions

View file

@ -180,7 +180,6 @@ export const upload = async (
endpoint.searchParams.append("name", name);
const fh = await open(path);
try {
const stream = fh.readableWebStream();
const resp = await github.request({
method: "POST",
url: endpoint.toString(),
@ -189,7 +188,7 @@ export const upload = async (
"content-type": mime,
authorization: `token ${config.github_token}`,
},
data: stream,
data: fh.readableWebStream(),
});
const json = resp.data;
if (resp.status !== 201) {
@ -202,7 +201,7 @@ export const upload = async (
console.log(`✅ Uploaded ${name}`);
return json;
} finally {
await fh.close().catch(() => {});
await fh.close();
}
};