Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/add-to-ipfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function makeShareableObject (ipfs, results) {
return results[0]
}

let baseCID = await ipfs.object.new('unixfs-dir')
let baseCID = await ipfs.object.new({ template: 'unixfs-dir' })

for (const { cid, path, size } of results) {
baseCID = (await ipfs.object.patch.addLink(baseCID, {
Expand Down Expand Up @@ -87,11 +87,7 @@ module.exports = async function ({ getIpfsd, launchWebUI }, files) {

await Promise.all(files.map(async file => {
try {
let result = null
for await (const res of ipfsd.api.add(globSource(file, { recursive: true }))) {
result = res
}

const result = await ipfsd.api.add(globSource(file, { recursive: true }))
await copyFile(ipfsd.api, result.cid, result.path)
successes.push(result)
} catch (e) {
Expand Down