diff --git a/cli.js b/cli.js index f7b694a..7bad740 100755 --- a/cli.js +++ b/cli.js @@ -30,7 +30,11 @@ function runDat (state, bus) { state.title = 'Starting Dat program...' bus.emit('render') - dat(src, dest, argv, function (archive, network, progress) { + dat(src, dest, argv, function (err, archive, network, progress) { + if (err) { + console.error(err) + process.exit(1) + } state.archive = archive state.network = network state.progress = progress diff --git a/index.js b/index.js index 6eb5d05..f1dfadd 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,7 @@ function run (src, dest, opts, cb) { if (archive.metadata.writable) importFiles() else downloadFiles() var swarm = joinNetwork() - cb(archive, swarm, progress) + cb(null, archive, swarm, progress) }) function storage () {