diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-05-26 21:41:58 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-06-08 23:38:57 +0200 |
commit | 7965557b65883a6b91de61374764dab1fac778d4 (patch) | |
tree | ca095c35b37b24a1001e182ac9c3129651666242 | |
parent | dc1b198b0cce1d2da3acd47a442ad64ed92bcad9 (diff) | |
download | mkinitcpio-7965557b65883a6b91de61374764dab1fac778d4.tar.gz mkinitcpio-7965557b65883a6b91de61374764dab1fac778d4.tar.xz |
functions: style nits
Avoid using compound commands where one side runs a command group.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | functions | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -386,7 +386,9 @@ add_dir() { # $1: pathname on initcpio # $2: mode (optional) - { (( ! $# )) || [[ $1 != /?* ]]; } && return 1 + if [[ -z $1 || $1 != /?* ]]; then + return 1 + fi local path=$1 mode=${2:-755} @@ -430,7 +432,10 @@ add_file() { # determine source and destination local src=$1 dest=${2:-$1} mode= - [[ -f $src ]] || { error "file not found: \`%s'" "$src"; return 1; } + if [[ ! -f $src ]]; then + error "file not found: \`%s'" "$src" + return 1 + fi mode=${3:-$(stat -c %a "$src")} if [[ -z $mode ]]; then @@ -499,7 +504,10 @@ add_binary() { binary=$1 fi - [[ -f $binary ]] || { error "file not found: \`%s'" "$1"; return 1; } + if [[ ! -f $binary ]]; then + error "file not found: \`%s'" "$1" + return 1 + fi dest=${2:-$binary} mode=$(stat -c %a "$binary") |