aboutsummaryrefslogtreecommitdiff
path: root/libs/common
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-10-26 02:57:32 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-10-28 23:30:02 -0400
commitc7377e3eb74a73874f9d2253083b3ae952156ac8 (patch)
tree2958d720389814a0640a61625705cb6a72a9f4a9 /libs/common
parent85934d62d767a484fa560066b6edb69a18145690 (diff)
downloadlibrebootfr-c7377e3eb74a73874f9d2253083b3ae952156ac8.tar.gz
librebootfr-c7377e3eb74a73874f9d2253083b3ae952156ac8.zip
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.
Diffstat (limited to 'libs/common')
-rwxr-xr-xlibs/common4
1 files changed, 2 insertions, 2 deletions
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