From 06994f23d9b80be2e16804b7a4ee72d07aa76254 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 9 Jan 2016 18:01:45 +0200 Subject: [PATCH] use ls to expand spec count --- shrc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shrc.sh b/shrc.sh index d0f91f7..b616a41 100755 --- a/shrc.sh +++ b/shrc.sh @@ -335,7 +335,7 @@ __bash_parse_git_branch() { # if we are in rpm subdir and have exactly one .spec in the dir, include package version __package_rpmversion() { - if [[ $PWD =~ $(rpm -E %_topdir) ]] && [ "$(echo *.spec | wc -w)" = 1 ]; then + if [[ $PWD =~ $(rpm -E %_topdir) ]] && [ "$(\ls *.spec 2>/dev/null | wc -w)" = 1 ]; then # give only first version (ignore subpackages) rpm --specfile *.spec -q --qf '%{VERSION}\n' | head -n1 fi -- 2.44.0