Skip to content

Commit a357d10

Browse files
committed
[push][s]: upgraded 'clipboardy' version so it works on windows + fixed errors with progress bar on windows - refs #341
1 parent b780ad2 commit a357d10

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

bin/data-push.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,18 @@ Promise.resolve().then(async () => {
128128
// Check if a bar is already initiated:
129129
const barItem = progressBars.find(item => item.file === message.file)
130130
if (barItem) {
131-
if (message.completed) {
132-
barItem.bar.interrupt('Completed: ' + message.file)
133-
} else {
134-
barItem.bar.tick(message.chunk.length)
131+
try {
132+
if (message.completed) {
133+
if (process.platform !== 'win32') {
134+
barItem.bar.interrupt('Completed: ' + message.file)
135+
} else {
136+
info('Completed: ' + message.file)
137+
}
138+
} else {
139+
barItem.bar.tick(message.chunk.length)
140+
}
141+
} catch (err) {
142+
info(err.message)
135143
}
136144
} else { // If a bar doesn't exist initiate one:
137145
progressBars.push({
@@ -141,7 +149,7 @@ Promise.resolve().then(async () => {
141149
incomplete: ' ',
142150
width: 30,
143151
total: message.total,
144-
clear: true
152+
clear: process.platform === 'win32' ? false : true
145153
})
146154
})
147155
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"ansi-escapes": "^3.0.0",
7272
"boxen": "^1.3.0",
7373
"chalk": "^2.3.0",
74-
"clipboardy": "^1.1.4",
74+
"clipboardy": "^1.2.3",
7575
"data.js": "^0.11.5",
7676
"datahub-client": "^0.5.6",
7777
"first-run": "^1.2.0",

0 commit comments

Comments
 (0)