braidfs 0.0.102 → 0.0.103
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/index.js +14 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -396,12 +396,9 @@ async function sync_url(url) {
|
|
|
396
396
|
return p
|
|
397
397
|
}
|
|
398
398
|
var get_fullpath = async () => {
|
|
399
|
-
if (freed) return
|
|
400
399
|
var p = fullpath
|
|
401
|
-
while (await
|
|
402
|
-
if (freed) return
|
|
400
|
+
while (await is_dir(p))
|
|
403
401
|
p = require("path").join(p, 'index')
|
|
404
|
-
}
|
|
405
402
|
return p
|
|
406
403
|
}
|
|
407
404
|
if (!unsync_url.cache) unsync_url.cache = {}
|
|
@@ -412,12 +409,21 @@ async function sync_url(url) {
|
|
|
412
409
|
|
|
413
410
|
delete braid_text.cache[url]
|
|
414
411
|
for (let f of await braid_text.get_files_for_key(url)) {
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
try {
|
|
413
|
+
console.log(`trying to delete: ${f}`)
|
|
414
|
+
await require('fs').promises.unlink(f)
|
|
415
|
+
} catch (e) {}
|
|
417
416
|
}
|
|
418
417
|
|
|
419
|
-
try {
|
|
420
|
-
|
|
418
|
+
try {
|
|
419
|
+
console.log(`trying to delete: ${meta_path}`)
|
|
420
|
+
await require('fs').promises.unlink(meta_path)
|
|
421
|
+
} catch (e) {}
|
|
422
|
+
try {
|
|
423
|
+
var fp = await get_fullpath()
|
|
424
|
+
console.log(`trying to delete: ${fp}`)
|
|
425
|
+
await require('fs').promises.unlink(fp)
|
|
426
|
+
} catch (e) {}
|
|
421
427
|
}
|
|
422
428
|
sync_url.cache[path] = sync_url.chain = sync_url.chain.then(init)
|
|
423
429
|
}
|