summaryrefslogtreecommitdiffstats
path: root/src/ob-unpacksource.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 02:02:05 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 02:02:05 (EDT)
commit48a3f66f63720822ad0e9e9ca5772d8d92071875 (patch)
tree84393b711d2b14718d4dbf5cbbd485716522b7e8 /src/ob-unpacksource.sh
parent003e70a8dc1f2b38dfc66f7176ca94483003893f (diff)
ob-unpacksource: Replace echo with here-document
And drop the unnecessary grep.
Diffstat (limited to 'src/ob-unpacksource.sh')
-rw-r--r--src/ob-unpacksource.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh
index 06e0ba9..c07a67b 100644
--- a/src/ob-unpacksource.sh
+++ b/src/ob-unpacksource.sh
@@ -78,7 +78,11 @@ get_upstream_dir()
{
upstream_ar_dir="$(tar "-t${upstream_ar_z}f" "${upstream_ar}" | \
sed -n 's|^\(\./\)\{0,1\}\([^/]\{1,\}\).*$|\2|p' | sort | uniq)"
- case "$(echo "${upstream_ar_dir}" | grep -v '^$' | wc -l)" in
+ dir_count="$(wc -l <<-EOF
+ "${upstream_ar_dir}"
+ EOF
+ )"
+ case "${dir_count}" in
0)
ob_error "$(ob_get_msg 'no_upstream_dirs')"
;;