Skip to content

Commit 1984575

Browse files
ctruedenclaude
andcommitted
Add NO_PROGRESS environment variable to disable progress bars
Add support for NO_PROGRESS environment variable to disable progress bars, similar to how COLOR controls ANSI styling. This is particularly useful for testing and CI environments. Changes: - maven/resolver.py: Check NO_PROGRESS env var before showing progress - bin/test.sh: Set NO_PROGRESS=1 by default for CLI tests Progress bars are now disabled when: - --quiet flag is used - NO_PROGRESS environment variable is set (any value) - Content-Length header is missing or zero All 518 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ff42fcb commit 1984575

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

bin/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ if [ ${#prysk_args[@]} -gt 0 ] && command -v prysk; then
4848
# Use `uv tool install prysk` instead.
4949
#
5050
# We set COLOR=never by default to avoid ANSI codes in test output.
51+
# We set NO_PROGRESS=1 to disable progress bars in test output.
5152
# This is especially important for CI, which may or may not detect
5253
# as ANSI-color-compatible compared to local usage of prysk.
5354
# Tests can override this (e.g., color.t does).
54-
COLOR="${COLOR:-never}" prysk -v "${prysk_args[@]}"
55+
COLOR="${COLOR:-never}" NO_PROGRESS="${NO_PROGRESS:-1}" prysk -v "${prysk_args[@]}"
5556
prysk_status=$?
5657
if [ $prysk_status -ne 0 ]; then
5758
exit_status=$prysk_status

src/jgo/maven/resolver.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,14 @@ def download(self, artifact: Artifact) -> Path | None:
316316
# Get total size from Content-Length header
317317
total_size = int(response.headers.get("content-length", 0))
318318

319-
# Show progress bar unless in quiet mode
320-
show_progress = not is_quiet() and total_size > 0
319+
# Show progress bar unless in quiet mode or NO_PROGRESS is set
320+
import os
321+
322+
show_progress = (
323+
not is_quiet()
324+
and total_size > 0
325+
and not os.environ.get("NO_PROGRESS")
326+
)
321327

322328
if show_progress:
323329
# Create progress bar for this download

0 commit comments

Comments
 (0)