Skip to content

Commit

Permalink
[push][s]: upgraded 'clipboardy' version so it works on windows + fix…
Browse files Browse the repository at this point in the history
…ed errors with progress bar on windows - refs #341
  • Loading branch information
anuveyatsu committed May 28, 2018
1 parent b780ad2 commit a357d10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions bin/data-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@ Promise.resolve().then(async () => {
// Check if a bar is already initiated:
const barItem = progressBars.find(item => item.file === message.file)
if (barItem) {
if (message.completed) {
barItem.bar.interrupt('Completed: ' + message.file)
} else {
barItem.bar.tick(message.chunk.length)
try {
if (message.completed) {
if (process.platform !== 'win32') {
barItem.bar.interrupt('Completed: ' + message.file)
} else {
info('Completed: ' + message.file)
}
} else {
barItem.bar.tick(message.chunk.length)
}
} catch (err) {
info(err.message)
}
} else { // If a bar doesn't exist initiate one:
progressBars.push({
Expand All @@ -141,7 +149,7 @@ Promise.resolve().then(async () => {
incomplete: ' ',
width: 30,
total: message.total,
clear: true
clear: process.platform === 'win32' ? false : true
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"ansi-escapes": "^3.0.0",
"boxen": "^1.3.0",
"chalk": "^2.3.0",
"clipboardy": "^1.1.4",
"clipboardy": "^1.2.3",
"data.js": "^0.11.5",
"datahub-client": "^0.5.6",
"first-run": "^1.2.0",
Expand Down

0 comments on commit a357d10

Please sign in to comment.