Skip to content

Commit

Permalink
Fixes 'exiting in true seconds' bug on dat clone. (#1116) (#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtualWolf authored and okdistribute committed Mar 24, 2020
1 parent 029e71d commit e2b94c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/commands/pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
{
name: 'exit',
boolean: false,
help: 'exit after specified number of seconds (gives the dat network time to find updates). defaults to 12 seconds.'
help: 'exit after specified number of seconds, to give the dat network time to find updates. (default: 12)'
},

{
Expand Down Expand Up @@ -66,8 +66,10 @@ function pull (opts) {
opts.createIfMissing = false

// If --exit is specified without a number of seconds, default to 12
if (opts.exit === true) {
opts.exit = 12
if (opts.exit) {
opts.exit = typeof opts.exit === 'number'
? opts.exit
: 12
}

var neat = neatLog(archiveUI, { logspeed: opts.logspeed, quiet: opts.quiet, debug: opts.debug })
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function networkUI (state) {
}
}

if (state.opts.exit) {
if (typeof state.opts.exit === 'number') {
title = `dat synced, exiting in ${state.opts.exit} seconds.`
}

Expand Down

0 comments on commit e2b94c8

Please sign in to comment.