Skip to content

Commit f10c444

Browse files
committed
refactor: use BASHUNIT_PROGRESS_BAR instead of just PROGRESS
1 parent 60ac81e commit f10c444

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

bashunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ while [[ $# -gt 0 ]]; do
6565
set -x
6666
;;
6767
-pb|--progress-bar)
68-
export BASHUNIT_PROGRESS=true
68+
export BASHUNIT_PROGRESS_BAR=true
6969
;;
7070
-b|--bench)
7171
_BENCH_MODE=true

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ BASHUNIT_VERBOSE=true
249249

250250
## Progress bar
251251

252-
> `BASHUNIT_PROGRESS=true|false`
252+
> `BASHUNIT_PROGRESS_BAR=true|false`
253253
254254
Controls whether the progress bar is rendered. `false` by default.
255255

256256
::: code-group
257257
```bash [Example]
258-
BASHUNIT_PROGRESS=true
258+
BASHUNIT_PROGRESS_BAR=true
259259
```
260260
:::
261261

src/env.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _DEFAULT_STOP_ON_FAILURE="false"
2828
_DEFAULT_SHOW_EXECUTION_TIME="true"
2929
_DEFAULT_VERBOSE="false"
3030
_DEFAULT_BENCH_MODE="false"
31-
_DEFAULT_PROGRESS="false"
31+
_DEFAULT_PROGRESS_BAR="false"
3232

3333
# Controls if the progress bar should render during execution
3434
_PROGRESS_ENABLED=true
@@ -41,7 +41,7 @@ _PROGRESS_ENABLED=true
4141
: "${BASHUNIT_SHOW_EXECUTION_TIME:=${SHOW_EXECUTION_TIME:=$_DEFAULT_SHOW_EXECUTION_TIME}}"
4242
: "${BASHUNIT_VERBOSE:=${VERBOSE:=$_DEFAULT_VERBOSE}}"
4343
: "${BASHUNIT_BENCH_MODE:=${BENCH_MODE:=$_DEFAULT_BENCH_MODE}}"
44-
: "${BASHUNIT_PROGRESS:=${PROGRESS:=$_DEFAULT_PROGRESS}}"
44+
: "${BASHUNIT_PROGRESS_BAR:=${PROGRESS_BAR:=$_DEFAULT_PROGRESS_BAR}}"
4545

4646
function env::is_parallel_run_enabled() {
4747
[[ "$BASHUNIT_PARALLEL_RUN" == "true" ]]
@@ -79,8 +79,8 @@ function env::is_bench_mode_enabled() {
7979
[[ "$BASHUNIT_BENCH_MODE" == "true" ]]
8080
}
8181

82-
function env::is_progress_enabled() {
83-
[[ "$BASHUNIT_PROGRESS" == "true" ]]
82+
function env::is_progress_bar_enabled() {
83+
[[ "$BASHUNIT_PROGRESS_BAR" == "true" ]]
8484
}
8585

8686
function env::active_internet_connection() {

src/progress.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function progress::init() {
55
# Track the last rendered progress state so the bar can be redrawn
66
export PROGRESS_CURRENT=0
77

8-
if parallel::is_enabled || [[ ! -t 1 ]] || ! env::is_progress_enabled; then
8+
if parallel::is_enabled || [[ ! -t 1 ]] || ! env::is_progress_bar_enabled; then
99
_PROGRESS_ENABLED=false
1010
else
1111
_PROGRESS_ENABLED=true

0 commit comments

Comments
 (0)