libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 3ca13619e3b8abca9d8ed0b2ac46263e82fa2223
parent f2b4de9e7cd357ef87c9a2f65ecd0368f1b26e88
Author: Francis Rowe <info@gluglug.org.uk>
Date:   Sat, 13 Jun 2015 16:02:57 +0100

download script: use a standard style (compared to other scripts)

Diffstat:
download | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/download b/download @@ -22,30 +22,30 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -download=./resources/scripts/helpers/download +download="./resources/scripts/helpers/download" programme="unknown" usage="./download programme" -availableprogrammes="$(ls $download/)" +availableprogrammes="$(ls ${download}/)" # User specified no or too few/many parameters if (( $# != 1 )); then - printf "$usage\n\n" - printf "possible values for 'programme':\nall:\n$availableprogrammes\n\n" + printf "%s\n\n" "${usage}" + printf "possible values for 'programme':\nall:\n%s\n\n" "${availableprogrammes}" printf "Example (download everything): ./download all\n" printf "Example (download coreboot): ./download coreboot\n\n" exit 1 fi -programme=$1 +programme="${1}" -if [ "$programme" = "all" ]; then - for programme in $availableprogrammes; do - $download/$programme +if [ "${programme}" = "all" ]; then + for programme in ${availableprogrammes}; do + ${download}/${programme} done -elif [ -f "$download/$programme" ]; then - $download/$programme +elif [ -f "${download}/${programme}" ]; then + ${download}/${programme} else - printf "Invalid programme. Available programmes are:\nall\n$availableprogrammes\n" + printf "Invalid programme. Available programmes are:\nall\n%s\n" "${availableprogrammes}" exit 1 fi