summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author百地 希留耶 <65301509+KiruyaMomochi@users.noreply.github.com>2022-03-10 02:07:07 +0900
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-04-14 11:08:17 +0200
commit08009ffd7097d1d19ab1ca3fc3c8ee24ee4a8858 (patch)
tree322561da5e8ab585c99e46416a090f43d9350ac4
parentd4f23268245333bb32f13606dbc3d53c1f862002 (diff)
downloadspack-08009ffd7097d1d19ab1ca3fc3c8ee24ee4a8858.tar.gz
spack-08009ffd7097d1d19ab1ca3fc3c8ee24ee4a8858.tar.bz2
spack-08009ffd7097d1d19ab1ca3fc3c8ee24ee4a8858.tar.xz
spack-08009ffd7097d1d19ab1ca3fc3c8ee24ee4a8858.zip
Hide package repository count when redirecting stdout (#29402)
-rw-r--r--lib/spack/spack/cmd/repo.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py
index 250f57dcd7..e7e340521c 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