usebeeline 0.1.106 → 0.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/usebeeline.mjs +10 -1
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -154,11 +154,19 @@ async function ordinaryDirectory(path) {
|
|
|
154
154
|
const info = await lstat2(path).catch(() => void 0);
|
|
155
155
|
return Boolean(info?.isDirectory() && canonicalStoragePath(await realpath(path)) === canonicalStoragePath(path));
|
|
156
156
|
}
|
|
157
|
-
async function storageTree(root) {
|
|
157
|
+
async function storageTree(root, progress) {
|
|
158
|
+
let lastProgress = 0;
|
|
159
|
+
const advanced = async () => {
|
|
160
|
+
if (progress && Date.now() - lastProgress >= 1e3) {
|
|
161
|
+
lastProgress = Date.now();
|
|
162
|
+
await progress();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
158
165
|
if (process.platform === "darwin") {
|
|
159
166
|
const tree2 = /* @__PURE__ */ new Map();
|
|
160
167
|
const visit = async (path) => {
|
|
161
168
|
const info = await lstat2(path);
|
|
169
|
+
await advanced();
|
|
162
170
|
tree2.set(path, {
|
|
163
171
|
dev: info.dev,
|
|
164
172
|
ino: info.ino,
|
|
@@ -193,6 +201,7 @@ async function storageTree(root) {
|
|
|
193
201
|
child.stdout.setEncoding("utf8");
|
|
194
202
|
for await (const chunk of child.stdout) {
|
|
195
203
|
pending += chunk;
|
|
204
|
+
await advanced();
|
|
196
205
|
let newline;
|
|
197
206
|
while ((newline = pending.indexOf("\n")) >= 0) {
|
|
198
207
|
add(pending.slice(0, newline));
|