Commit 1e50b700e5a159d12d2bcd376af3c4b0a80c8000
show a progress bar, but only if stdout is a TTY
Dominic Tarr committed on 6/9/2017, 11:32:59 PMParent: 5580e6a2549e71500ea6cc7af3b4c5b5f21684fa
Files changed
bin.js | changed |
bin.js | ||
---|---|---|
@@ -11,8 +11,9 @@ | ||
11 | 11 | var createHash = require('multiblob/util').createHash |
12 | 12 | var minimist = require('minimist') |
13 | 13 | var muxrpcli = require('muxrpcli') |
14 | 14 | var cmdAliases = require('./lib/cli-cmd-aliases') |
15 | +var ProgressBar = require('./lib/progress') | |
15 | 16 | |
16 | 17 | //get config as cli options after --, options before that are |
17 | 18 | //options to the command. |
18 | 19 | var argv = process.argv.slice(2) |
@@ -47,9 +48,8 @@ | ||
47 | 48 | .use(require('./plugins/private')) |
48 | 49 | .use(require('ssb-query')) |
49 | 50 | .use(require('ssb-links')) |
50 | 51 | .use(require('ssb-ws')) |
51 | -// .use(require('ssb-ebt')) | |
52 | 52 | |
53 | 53 | // add third-party plugins |
54 | 54 | require('./plugins/plugins').loadUserPlugins(createSbot, config) |
55 | 55 | |
@@ -59,8 +59,11 @@ | ||
59 | 59 | var server = createSbot(config) |
60 | 60 | |
61 | 61 | // write RPC manifest to ~/.ssb/manifest.json |
62 | 62 | fs.writeFileSync(manifestFile, JSON.stringify(server.getManifest(), null, 2)) |
63 | + | |
64 | + if(process.stdout.isTTY) | |
65 | + ProgressBar(server.progress) | |
63 | 66 | } else { |
64 | 67 | |
65 | 68 | // normal command: |
66 | 69 | // create a client connection to the server |
@@ -146,7 +149,4 @@ | ||
146 | 149 | }) |
147 | 150 | } |
148 | 151 | |
149 | 152 | |
150 | - | |
151 | - | |
152 | - |
Built with git-ssb-web