diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-04-05 21:13:16 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-04-05 21:13:16 -0500 |
commit | 26c2a8cca75e9eb100b80a3442283fc2e1b64dad (patch) | |
tree | fe704eb3789d0e816bee1562b1dc33414dfad371 | |
parent | 75830a5018d98c55dd7157507cc18fc3c2aa774d (diff) |
Add test block to check if package exists in packages.csv and exit if it doesn't.
-rw-r--r-- | packageinstall.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/packageinstall.sh b/packageinstall.sh index 88876ac..78e2cdd 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -3,7 +3,7 @@ CHAPTER="$1" PACKAGE="$2" -if ! grep "^${PACKAGE}" packages.csv; then +if ! grep -q "^${PACKAGE}" packages.csv; then printf "%b" " ${IRED}PACKAGE ${IYLW}${PACKAGE} ${IRED}DOES NOT EXIST!${RST}\n" exit 1 fi @@ -18,9 +18,6 @@ else CACHEFILE="$(basename "${URL}")" DIRNAME="$(tar -tf "${CACHEFILE}" | sed -e 's@/.*@@' | uniq)" - echo $NAME - exit 1 - # Remove existing if exists rm -rf "${DIRNAME}" |