Skip to content

Commit

Permalink
fix(deployment): log about uploading if non TTY stream
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Feb 8, 2017
1 parent ea85810 commit 4546b1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ For an app that will be shipped to production, you should sign your application.

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).

## Boilerplates

* [electron-react-boilerplate](https://github.com/chentsulin/electron-react-boilerplate)
* [electron-react-redux-boilerplate](https://github.com/jschr/electron-react-redux-boilerplate)
* [electron-boilerplate](https://github.com/szwacz/electron-boilerplate)
* [electron-vue](https://github.com/SimulatedGREG/electron-vue)

This comment has been minimized.

Copy link
@SimulatedGREG

SimulatedGREG Feb 18, 2017

Thank you @develar


## CLI Usage
Execute `node_modules/.bin/build --help` to get the actual CLI usage guide.
```
Expand Down
10 changes: 7 additions & 3 deletions packages/electron-builder-publisher/src/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ProgressCallbackTransform } from "electron-builder-http/out/ProgressCal
import { MultiProgress } from "./multiProgress"
import { CancellationToken } from "electron-builder-http/out/CancellationToken"
import { green } from "chalk"
import { log } from "electron-builder-util/out/log"

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

Expand Down Expand Up @@ -34,8 +35,9 @@ export abstract class Publisher {

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

protected createProgressBar(fileName: string, fileStat: Stats) {
protected createProgressBar(fileName: string, fileStat: Stats): ProgressBar | null {
if (this.context.progress == null) {
log(`Uploading ${fileName} to ${this.providerName}`)
return null
}
else {
Expand Down Expand Up @@ -71,8 +73,10 @@ export abstract class HttpPublisher extends Publisher {

const progressBar = this.createProgressBar(fileName, fileStat)
await this.doUpload(fileName, fileStat.size, (request, reject) => {
// reset (because can be called several times (several attempts)
progressBar.update(0)
if (progressBar != null) {
// reset (because can be called several times (several attempts)
progressBar.update(0)
}
return this.createReadStreamAndProgressBar(file, fileStat, progressBar, reject).pipe(request)
}, file)
}
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ acorn-globals@^3.1.0:
acorn "^4.0.4"

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

align-text@^0.1.1, align-text@^0.1.3:
version "0.1.4"
Expand Down

0 comments on commit 4546b1c

Please sign in to comment.