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 /libs/tool | |
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 'libs/tool')
-rwxr-xr-x | libs/tool | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -236,7 +236,7 @@ tool_sources_path() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi @@ -292,7 +292,7 @@ tool_usage_arguments_recursive() { local action_helper_arguments=$( tool_action_helper "arguments" "$tool" "$@" ) local argument - if ! [[ -z "$action_helper_arguments" ]] + if [[ -n "$action_helper_arguments" ]] then printf '%s\n' "$action_helper_arguments" | while read argument do @@ -317,7 +317,7 @@ tool_file_path() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi @@ -368,7 +368,7 @@ tool_file_contents_herit() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi |