Skip to content

Commit a1d7ec3

Browse files
committed
fix(cli): print plugin downloading status to stderr (#2269)
Printing the status to stdout causes problems when piping the results of a query command to another bazel command. --- ### Type of change - Bug fix (change which fixes an issue) **For changes visible to end-users** - Suggested release notes are provided below: Aspect CLI plugin downloading status line is now printed to stderr. ### Test plan - Manual testing; please provide instructions so we can reproduce: Pipe a cli query call to another bazel command. For example, first clear any bazelisk / aspect cli caches ``` $ rm -rf ~/Library/Caches/aspect $ rm -rf ~/Library/Caches/aspect-cli $ rm -rf ~/Library/Caches/bazelisk ``` then pipe a bazel query into a bazel build ``` $ /Users/greg/aspect/silo/bazel-bin/cli/core/cmd/aspect/aspect_/aspect build $(/Users/greg/aspect/silo/bazel-bin/cli/core/cmd/aspect/aspect_/aspect query //somepath/...) 2023/05/26 17:05:41 Downloading https://releases.bazel.build/6.1.1/release/bazel-6.1.1-darwin-x86_64... Downloading https://github.com/aspect-build/plugin-fix-visibility/releases/download/v0.1.0/fix-visibility-darwin_amd64... Downloading https://static.aspect.build/aspect/5.1.10/plugin-aspect-workflows-darwin_amd64... Downloading https://static.aspect.build/aspect/5.1.10/plugin-aspect-workflows-darwin_amd64.sha256... Downloading https://github.com/aspect-build/plugin-fix-visibility/releases/download/v0.1.0/fix-visibility-darwin_amd64.sha256... Loading: 0 packages loaded Loading: 0 packages loaded INFO: Analyzed N targets (0 packages loaded, 0 targets configured). INFO: Found N targets... Target //somepath:foobar up-to-date: bazel-bin/somepath/foobar INFO: Elapsed time: 0.305s, Critical Path: 0.00s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action ``` GitOrigin-RevId: aa6993e581ff6e9e75da82dae485866919862a92
1 parent 5e51343 commit a1d7ec3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/plugin/client/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func downloadFile(originURL, destDir, destFile string, mode fs.FileMode) (string
108108
defer os.Remove(tmpfile.Name())
109109
defer tmpfile.Close()
110110

111-
faint.Println("Downloading", originURL)
111+
faint.Fprintf(os.Stderr, "Downloading %s...\n", originURL)
112112

113113
resp, err := http.Get(originURL)
114114
if err != nil {

0 commit comments

Comments
 (0)