Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 028400e

Browse files
committed
fix files.write
1 parent 774a51e commit 028400e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,15 @@ function IpfsAPI (host_or_multiaddr, port) {
253253
return requestAPI('files/rm', path, opts, null, cb)
254254
},
255255
read: argCommand('files/read'),
256-
write: argCommand('files/write'),
256+
// write: argCommand('files/write'),
257+
write: function (pathDst, files, opts, cb) {
258+
if (typeof (opts) === 'function' && cb === undefined) {
259+
cb = opts
260+
opts = {}
261+
}
262+
263+
return requestAPI('files/write', pathDst, opts, files, cb)
264+
},
257265
mv: argCommand('files/mv')
258266
}
259267
}

0 commit comments

Comments
 (0)