We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b23ef89 commit a229aa9Copy full SHA for a229aa9
src/bundles/files/actions.js
@@ -415,6 +415,17 @@ const actions = () => ({
415
const cid = result[0].root.cid
416
const src = `/ipfs/${cid}`
417
const dst = realMfsPath(join(root, name))
418
+ let dstExists = false
419
+
420
+ // Check if destination path already exists
421
+ await ipfs.files.stat(dst).then(() => {
422
+ dstExists = true
423
+ })
424
425
+ if (dstExists) {
426
+ throw new Error(`The name "${name}" already exists in the current directory. Try importing with a different name.`)
427
+ }
428
429
try {
430
await ipfs.files.cp(src, dst)
431
} catch (err) {
0 commit comments