diff --git a/cli.js b/cli.js index c30875d..f7b694a 100755 --- a/cli.js +++ b/cli.js @@ -4,6 +4,7 @@ var minimist = require('minimist') var pretty = require('prettier-bytes') var speed = require('speedometer') var progress = require('progress-string') +var cliTruncate = require('cli-truncate') var neatLog = require('neat-log') var output = require('neat-log/output') @@ -219,9 +220,10 @@ function importUI (state) { } }) } + var name = state.fileImport.dst.name return output` - ADD: ${state.fileImport.src.name} + ADD: ${cliTruncate(name, process.stdout.columns - 5, {position: 'start'})} ${state.fileImport.bar(state.fileImport.progress)} ` } diff --git a/package.json b/package.json index 143cd69..2a86833 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "homepage": "https://github.com/joehand/dat-next#readme", "dependencies": { + "cli-truncate": "^1.0.0", "count-files": "^2.4.0", "dat-encoding": "^4.0.2", "dat-ignore": "^1.0.0",