diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-10-26 02:57:32 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-10-28 23:30:02 -0400 |
commit | c7377e3eb74a73874f9d2253083b3ae952156ac8 (patch) | |
tree | 2958d720389814a0640a61625705cb6a72a9f4a9 /tools | |
parent | 85934d62d767a484fa560066b6edb69a18145690 (diff) | |
download | librebootfr-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 'tools')
-rwxr-xr-x | tools/blobs-discover/blobs-discover | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/blobs-discover/blobs-discover b/tools/blobs-discover/blobs-discover index 3ced106c..5d197723 100755 --- a/tools/blobs-discover/blobs-discover +++ b/tools/blobs-discover/blobs-discover @@ -75,7 +75,7 @@ verify() { requirements "sort" - if ! [[ -z "$project_blobs_path" ]] + if [[ -n "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else @@ -136,7 +136,7 @@ execute() { local project_blobs_ignore_path=$( project_blobs_ignore_path "$project" "$@" ) local project_blobs_directory_path - if ! [[ -z "$project_blobs_path" ]] + if [[ -n "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else @@ -159,7 +159,7 @@ execute() { printf '%s\n' "$files" | while read file do - if ! [[ -z "$project_blobs_ignore_path" ]] + if [[ -n "$project_blobs_ignore_path" ]] then match=$( grep "$file" "$project_blobs_ignore_path" || true) if [[ ! -z "$match" ]] @@ -169,7 +169,7 @@ execute() { fi match=$( "$deblob_check_path" -l -i "" "$file" || true ) - if ! [[ -z "$match" ]] + if [[ -n "$match" ]] then printf '%s\n' "$match" >> "$project_blobs_discover_path" fi @@ -187,7 +187,7 @@ execute_check() { local project_blobs_ignore_path=$( project_blobs_ignore_path "$project" "$@" ) local project_blobs_discover_path - if ! [[ -z "$project_blobs_path" ]] + if [[ -n "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else |