Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 'exiting in true seconds' bug on dat clone. (#1116) #1127

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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