summaryrefslogtreecommitdiff
path: root/resources/scripts/download
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-15 02:38:22 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-15 02:38:22 +0100
commit86512e84bea014a9b9e71b1a5adee93810cba411 (patch)
tree71c808e25ab1371d9283d478df481ba65ad334f9 /resources/scripts/download
parentd28584f3d039adc3753e0051081f68b96f1ecadd (diff)
download/coreboot: simplify small if statements
Diffstat (limited to 'resources/scripts/download')
-rwxr-xr-xresources/scripts/download/coreboot17
1 files changed, 6 insertions, 11 deletions
diff --git a/resources/scripts/download/coreboot b/resources/scripts/download/coreboot
index e0c55c9c..d8b44ab3 100755
--- a/resources/scripts/download/coreboot
+++ b/resources/scripts/download/coreboot
@@ -84,26 +84,21 @@ download_coreboot_for_board()
if [ -d "coreboot/${cbtree}" ]; then
printf "REMARK: download/coreboot %s: exists. Skipping.\n" \
${cbtree}
- if [ "${cbtree}" != "${1}" ]; then
- printf "(for board: '${1}')\n"
- fi
+ [ "${cbtree}" != "${1}" ] && \
+ printf "(for board: '%s}')\n" ${1}
return 0
fi
- if [ ! -d coreboot ]; then
+ [ ! -d coreboot ] && \
mkdir "coreboot/"
- fi
- if [ ! -d coreboot ]; then
- printf "ERROR: download/coreboot: directory not created."
- printf " Check file system permissions\n"
+ [ ! -d coreboot ] && \
+ printf "ERROR: download/coreboot: directory not created\n" && \
return 1
- fi
cd "coreboot/"
- if [ ! -d coreboot/.git ] && [ -d coreboot ]; then
+ [ ! -d coreboot/.git ] && [ -d coreboot ] && \
rm -Rf coreboot/
- fi
if [ ! -d coreboot ]; then
printf "Download coreboot from upstream:\n"