Skip to content

Commit 832ae44

Browse files
committed
Fixed erased folder when size cannot be handled
1 parent cfc62b3 commit 832ae44

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

Diff for: docs/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: docs/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: esm/interpreter/_nativefs.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { mkdirTree } from './_utils.js';
22

3+
async function syncfs(FS, direction) {
4+
return new Promise((resolve, reject) => {
5+
FS.syncfs(direction, err => {
6+
if (err) reject(err);
7+
else resolve();
8+
});
9+
});
10+
}
11+
312
// (C) Pyodide https://github.com/pyodide/pyodide - Mozilla Public License Version 2.0
413
// JS port of https://github.com/pyodide/pyodide/blob/34fcd02172895d75db369994011409324f9e3cce/src/js/nativefs.ts
514
export function initializeNativeFS(module) {
@@ -265,13 +274,13 @@ export function initializeNativeFS(module) {
265274
{ fileSystemHandle },
266275
path,
267276
);
268-
277+
269278
// sync native ==> browser
270-
await new Promise($ => FS.syncfs(true, $));
271-
279+
await syncfs(FS, true);
280+
272281
return {
273282
// sync browser ==> native
274-
syncfs: () => new Promise($ => FS.syncfs(false, $)),
283+
syncfs: async () => await syncfs(FS, false),
275284
};
276285
};
277286
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@
9494
"to-json-callback": "^0.1.1"
9595
},
9696
"worker": {
97-
"blob": "sha256-0wd916BW20JpkmHfpwIyLYYvtV2iGIgaef2TXDirEao="
97+
"blob": "sha256-62NQHNKhtPYl3hwHE08fYFF4F1HihbBJD0y8Xw25frA="
9898
}
9999
}

0 commit comments

Comments
 (0)