Skip to content

Commit

Permalink
throw error for download without dest
Browse files Browse the repository at this point in the history
  • Loading branch information
joehand committed Apr 6, 2017
1 parent bcc6ef5 commit 021baff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function run (src, dest, opts, cb) {
var archive = hyperdrive(storage(), key, opts)

archive.on('ready', function () {
if (!archive.metadata.writable && !dest) {
return cb(new Error('Archive is not writable and no destination provided.'))
}
if (archive.metadata.writable) importFiles()
else downloadFiles()
var swarm = joinNetwork()
Expand Down

0 comments on commit 021baff

Please sign in to comment.