diff mbox series

[PATCHv2,4/4] scripts/clean-package.sh: switch from -a in if to &&

Message ID 20200711184528.47605-4-rosenp@gmail.com
State New
Headers show
Series [PATCHv2,1/4] scripts/clean-package.sh: exit in case cd fails | expand

Commit Message

Rosen Penev July 11, 2020, 6:45 p.m. UTC
-a is not well defined.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v2: rebased
 scripts/clean-package.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index 03e49df3e7..ccbb486eea 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -1,13 +1,14 @@ 
 #!/usr/bin/env bash
 IFS=$'\n'
-[ -n "$1" -a -n "$2" ] || {
+
+if [ -z "$1" ] || [ -z "$2" ]; then
 	echo "Usage: $0 <file> <directory>"
 	exit 1
-}
-[ -f "$1" -a -d "$2" ] || {
+fi
+if [ ! -f "$1" ] || [ ! -d "$2" ]; then
 	echo "File/directory not found"
 	exit 1
-}
+fi
 (
 	cd "$2" || exit 1
 	while read -r entry; do