This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
parents: true
not work for ipfs.files.cp
#3747
Labels
need/triage
Needs initial labeling and prioritization
Comments
Can you please provide some steps to reproduce the error? |
|
file_path is not defined? Can you share a stack trace? |
import { searchIpfs } from '../lib/ipfs/use';
import { ipfsAddresses } from 'ipfs-util-lib';
import console from 'debug-color2/logger';
searchIpfs()
.then(async ({ ipfs, stop }) => {
const dir_path = `/1/2/3`;
const file_path = `${dir_path}/file.txt`;
const file_cid = `QmWGpaUBePXU3jyCXtY4hmtmawYSep8QnnBoziiqdzbGVH`;
await ipfs.version().then(console.info);
let dir_stat = await ipfs.files.stat(dir_path).catch(e => null);
let file_stat = await ipfs.files.stat(file_path).catch(e => null);
console.dir({
dir_stat,
file_stat,
});
// await ipfs.files.mkdir(dir_path, {
// parents: true,
// }).catch(e => null);
await ipfs.files.rm(file_path).catch(e => null);
await ipfs.files.cp(`/ipfs/${file_cid}`, file_path, {
parents: true,
});
return stop()
}) |
The error is coming from go-ipfs and I don’t think it’s cp command supports the parents option, you’ll need to mkdir first. |
3 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Severity:
Description:
parents: true
not work for ipfs.files.cpSteps to reproduce the error:
The text was updated successfully, but these errors were encountered: