diff options
author | 百地 希留耶 <65301509+KiruyaMomochi@users.noreply.github.com> | 2022-03-10 02:07:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 17:07:07 +0000 |
commit | 3270aa106b583aa1a36bd74c745c557a83fb39c6 (patch) | |
tree | 9e2eadc500a9d27a3355bfe40ee27cd4d11c1382 /lib/spack | |
parent | 2dd9414bbb55ff5c47b028b9b5f82afb62dd98e1 (diff) | |
download | spack-3270aa106b583aa1a36bd74c745c557a83fb39c6.tar.gz spack-3270aa106b583aa1a36bd74c745c557a83fb39c6.tar.bz2 spack-3270aa106b583aa1a36bd74c745c557a83fb39c6.tar.xz spack-3270aa106b583aa1a36bd74c745c557a83fb39c6.zip |
Hide package repository count when redirecting stdout (#29402)
Diffstat (limited to 'lib/spack')
-rw-r--r-- | lib/spack/spack/cmd/repo.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py index a2e1d84e93..5fd6ba463e 100644 --- a/lib/spack/spack/cmd/repo.py +++ b/lib/spack/spack/cmd/repo.py @@ -6,6 +6,7 @@ from __future__ import print_function import os +import sys import llnl.util.tty as tty @@ -142,9 +143,10 @@ def repo_list(args): except spack.repo.RepoError: continue - msg = "%d package repositor" % len(repos) - msg += "y." if len(repos) == 1 else "ies." - tty.msg(msg) + if sys.stdout.isatty(): + msg = "%d package repositor" % len(repos) + msg += "y." if len(repos) == 1 else "ies." + tty.msg(msg) if not repos: return |