From c7377e3eb74a73874f9d2253083b3ae952156ac8 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 26 Oct 2017 02:57:32 -0400 Subject: Make use of Bash's '-n' operator for tests As an example, do this: [[ -n $revision ]] instead of this: ! [[ -z $revision ]] Makes the code easier to read. --- libs/common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/common') diff --git a/libs/common b/libs/common index b7a7022e..28a34cf7 100755 --- a/libs/common +++ b/libs/common @@ -414,7 +414,7 @@ arguments_concat() { for argument in "$@" do - if ! [[ -z "$concat" ]] + if [[ -n "$concat" ]] then concat="$concat""$delimiter""$argument" else @@ -432,7 +432,7 @@ execute_root() { printf 1>&2 '%s' 'Running command as root: ' printf 1>&2 '%b\n' "$*" - if ! [[ -z "$sudo" ]] + if [[ -n "$sudo" ]] then sudo "$@" else -- cgit v1.2.3-70-g09d2