Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
cr
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 13, 2016
1 parent 9e3db34 commit 1484bbd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/cli/commands/files/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = {
throw err
}

// TODO: revist when interface-ipfs-core exposes pull-streams
// pull-stream -> stream -> pull-stream
// is not a good idea, so if we have a pull interface
// available, use it
Expand All @@ -80,8 +81,12 @@ module.exports = {
}

glob(path.join(inPath, '/**/*'), (err, list) => {
if (err) throw err
if (list.length === 0) list = [inPath]
if (err) {
throw err
}
if (list.length === 0) {
list = [inPath]
}

addPipeline(index, addStream, list)
})
Expand Down Expand Up @@ -114,7 +119,9 @@ function addPipeline (index, addStream, list) {
path: file.path
})),
pull.collect((err, added) => {
if (err) throw err
if (err) {
throw err
}

sortBy(added, 'path')
.reverse()
Expand Down

0 comments on commit 1484bbd

Please sign in to comment.