Skip to content

Commit 4546b1c

Browse files
committed
fix(deployment): log about uploading if non TTY stream
1 parent ea85810 commit 4546b1c

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ For an app that will be shipped to production, you should sign your application.
8080

8181
See the [Auto Update](https://github.com/electron-userland/electron-builder/wiki/Auto-Update) section of the [Wiki](https://github.com/electron-userland/electron-builder/wiki).
8282

83+
## Boilerplates
84+
85+
* [electron-react-boilerplate](https://github.com/chentsulin/electron-react-boilerplate)
86+
* [electron-react-redux-boilerplate](https://github.com/jschr/electron-react-redux-boilerplate)
87+
* [electron-boilerplate](https://github.com/szwacz/electron-boilerplate)
88+
* [electron-vue](https://github.com/SimulatedGREG/electron-vue)
89+
8390
## CLI Usage
8491
Execute `node_modules/.bin/build --help` to get the actual CLI usage guide.
8592
```

packages/electron-builder-publisher/src/publisher.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ProgressCallbackTransform } from "electron-builder-http/out/ProgressCal
66
import { MultiProgress } from "./multiProgress"
77
import { CancellationToken } from "electron-builder-http/out/CancellationToken"
88
import { green } from "chalk"
9+
import { log } from "electron-builder-util/out/log"
910

1011
export type PublishPolicy = "onTag" | "onTagOrDraft" | "always" | "never"
1112

@@ -34,8 +35,9 @@ export abstract class Publisher {
3435

3536
abstract upload(file: string, artifactName?: string): Promise<any>
3637

37-
protected createProgressBar(fileName: string, fileStat: Stats) {
38+
protected createProgressBar(fileName: string, fileStat: Stats): ProgressBar | null {
3839
if (this.context.progress == null) {
40+
log(`Uploading ${fileName} to ${this.providerName}`)
3941
return null
4042
}
4143
else {
@@ -71,8 +73,10 @@ export abstract class HttpPublisher extends Publisher {
7173

7274
const progressBar = this.createProgressBar(fileName, fileStat)
7375
await this.doUpload(fileName, fileStat.size, (request, reject) => {
74-
// reset (because can be called several times (several attempts)
75-
progressBar.update(0)
76+
if (progressBar != null) {
77+
// reset (because can be called several times (several attempts)
78+
progressBar.update(0)
79+
}
7680
return this.createReadStreamAndProgressBar(file, fileStat, progressBar, reject).pipe(request)
7781
}, file)
7882
}

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ acorn-globals@^3.1.0:
6565
acorn "^4.0.4"
6666

6767
acorn@^4.0.4:
68-
version "4.0.9"
69-
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.9.tgz#2d2eb458fe3f0e31062d56cf0b1839c5dc7bd288"
68+
version "4.0.10"
69+
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.10.tgz#598ed8bdd4de8b5a7a7fa2f6d2188ebbf9b1f12c"
7070

7171
align-text@^0.1.1, align-text@^0.1.3:
7272
version "0.1.4"

0 commit comments

Comments
 (0)