Hide package repository count when redirecting stdout (#29402)
This commit is contained in:
parent
2dd9414bbb
commit
3270aa106b
@ -6,6 +6,7 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
|
|
||||||
@ -142,9 +143,10 @@ def repo_list(args):
|
|||||||
except spack.repo.RepoError:
|
except spack.repo.RepoError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
msg = "%d package repositor" % len(repos)
|
if sys.stdout.isatty():
|
||||||
msg += "y." if len(repos) == 1 else "ies."
|
msg = "%d package repositor" % len(repos)
|
||||||
tty.msg(msg)
|
msg += "y." if len(repos) == 1 else "ies."
|
||||||
|
tty.msg(msg)
|
||||||
|
|
||||||
if not repos:
|
if not repos:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user