cli-eb-test
Advanced tools
Comparing version 2.6.0 to 2.7.0
@@ -42,5 +42,2 @@ const exec = require('child_process').exec | ||
Installer.prototype.install = function (newVersion) { | ||
console.log('') | ||
console.log('*** USER:', process.getuid()) | ||
console.log('') | ||
return fetch(url, { | ||
@@ -51,7 +48,16 @@ compress: false | ||
const writer = fs.createWriteStream(this.targetTmp) | ||
const progress = new ProgressBar('downloading [:bar] :percent (ETA: :etas)', { | ||
complete: '=', | ||
incomplete: ' ', | ||
width: 20, | ||
total: size | ||
let progress | ||
// We only want to print the progress bar if we're sure the | ||
// stream is writeable (i.e. we have the right permissions). | ||
writer.on('pipe', () => { | ||
if (!progress) { | ||
progress = new ProgressBar('downloading [:bar] :percent (ETA: :etas)', { | ||
complete: '=', | ||
incomplete: ' ', | ||
width: 20, | ||
total: size | ||
}) | ||
} | ||
}) | ||
@@ -63,3 +69,5 @@ | ||
.on('data', chunk => { | ||
progress.tick(chunk.length) | ||
if (progress) { | ||
progress.tick(chunk.length) | ||
} | ||
}) | ||
@@ -66,0 +74,0 @@ |
{ | ||
"name": "cli-eb-test", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"description": "A command-line tool for installation and customisation of the DADI platform", | ||
@@ -13,2 +13,3 @@ "bin": { | ||
"dependencies": { | ||
"colors": "^1.1.2", | ||
"latest-version": "^3.1.0", | ||
@@ -15,0 +16,0 @@ "node-fetch": "^1.7.3", |
@@ -26,2 +26,6 @@ const path = require('path') | ||
} | ||
}).catch(console.log) | ||
}).catch(err => { | ||
if (err.code === 'EACCES') { | ||
console.log('***** PERMISSION ISSUE') | ||
} | ||
}) |
50191040
180
5
+ Addedcolors@^1.1.2
+ Addedcolors@1.4.0(transitive)