@salesforce/sf-plugins-core 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/ux/progress.js +10 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.1](https://github.com/salesforcecli/sf-plugins-core/compare/v1.2.0...v1.2.1) (2022-01-27)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- protect against non-existent bar ([2d0dc37](https://github.com/salesforcecli/sf-plugins-core/commit/2d0dc37ce7fedfee4413ae91299de11c8cd9db93))
|
|
10
|
+
|
|
5
11
|
## [1.2.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.1.0...v1.2.0) (2022-01-27)
|
|
6
12
|
|
|
7
13
|
### Features
|
package/lib/ux/progress.js
CHANGED
|
@@ -23,7 +23,8 @@ class Progress extends _1.UxBase {
|
|
|
23
23
|
*/
|
|
24
24
|
setTotal(total) {
|
|
25
25
|
this.total = total;
|
|
26
|
-
this.bar
|
|
26
|
+
if (this.bar)
|
|
27
|
+
this.bar.setTotal(total);
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Start the progress bar.
|
|
@@ -38,7 +39,6 @@ class Progress extends _1.UxBase {
|
|
|
38
39
|
linewrap: opts.linewrap,
|
|
39
40
|
});
|
|
40
41
|
this.bar.setTotal(total);
|
|
41
|
-
// this.maybeNoop(() => startProgressBar(this.bar, total, payload));
|
|
42
42
|
this.maybeNoop(() => {
|
|
43
43
|
this._start(total, payload);
|
|
44
44
|
});
|
|
@@ -47,20 +47,24 @@ class Progress extends _1.UxBase {
|
|
|
47
47
|
* Update the progress bar.
|
|
48
48
|
*/
|
|
49
49
|
update(num, payload = {}) {
|
|
50
|
-
this.bar
|
|
50
|
+
if (this.bar)
|
|
51
|
+
this.bar.update(num, payload);
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Update the progress bar with the final number and stop it.
|
|
54
55
|
*/
|
|
55
56
|
finish(payload = {}) {
|
|
56
|
-
this.bar
|
|
57
|
-
|
|
57
|
+
if (this.bar) {
|
|
58
|
+
this.bar.update(this.total, payload);
|
|
59
|
+
this.bar.stop();
|
|
60
|
+
}
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* Stop the progress bar.
|
|
61
64
|
*/
|
|
62
65
|
stop() {
|
|
63
|
-
this.bar
|
|
66
|
+
if (this.bar)
|
|
67
|
+
this.bar.stop();
|
|
64
68
|
}
|
|
65
69
|
_start(total, payload = {}) {
|
|
66
70
|
const start = kit_1.once((bar, t, p = {}) => {
|