From 48a3f66f63720822ad0e9e9ca5772d8d92071875 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 02:02:05 -0400 Subject: ob-unpacksource: Replace echo with here-document And drop the unnecessary grep. --- 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')" ;; -- cgit v0.9.1