Skip to content

Commit 17b3761

Browse files
committed
[update] : Do not use if
1 parent 050c4bc commit 17b3761

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ _usage () {
171171
echo
172172
echo " Many packages are installed from AUR, so specifying --noaur can cause problems."
173173
echo
174-
if [[ -n "${1:-}" ]]; then exit "${1}"; fi
174+
[[ -n "${1:-}" ]] && exit "${1}"
175175
}
176176

177177
# Unmount helper Usage: _umount <target>
@@ -363,13 +363,13 @@ prepare_env() {
363363
fi
364364
_result=0
365365
done
366-
if [[ "${_check_failed}" = true ]]; then exit 1; fi
366+
[[ "${_check_failed}" = true ]] && exit 1
367367
fi
368368

369369
# Load loop kernel module
370370
if [[ "${noloopmod}" = false ]]; then
371-
if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then msg_error "The currently running kernel module could not be found.\nProbably the system kernel has been updated.\nReboot your system to run the latest kernel." "1"; fi
372-
if [[ -z "$(lsmod | getclm 1 | grep -x "loop")" ]]; then modprobe loop; fi
371+
[[ ! -d "/usr/lib/modules/$(uname -r)" ]] && msg_error "The currently running kernel module could not be found.\nProbably the system kernel has been updated.\nReboot your system to run the latest kernel." "1"
372+
[[ -z "$(lsmod | getclm 1 | grep -x "loop")" ]] && modprobe loop
373373
fi
374374

375375
# Check work dir
@@ -1305,7 +1305,7 @@ msg_debug "Use the default configuration file (${defaultconfig})."
13051305
[[ -f "${script_path}/custom.conf" ]] && msg_debug "The default settings have been overridden by custom.conf"
13061306

13071307
# Debug mode
1308-
if [[ "${bash_debug}" = true ]]; then set -x -v; fi
1308+
[[ "${bash_debug}" = true ]] && set -x -v
13091309

13101310
# Check for a valid channel name
13111311
if [[ -n "${1+SET}" ]]; then

0 commit comments

Comments
 (0)