summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-08-29 16:44:02 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2015-08-29 16:44:02 (EDT)
commit610711747339162004801b28a08cf81c33d65e48 (patch)
tree3309bb37f91e127fb67a97d6073ba6ed55a534ab
parentfcb1cfffb0e62aafd72994922b9c7aec1d4fbb5c (diff)
downloadlibreboot-610711747339162004801b28a08cf81c33d65e48.zip
libreboot-610711747339162004801b28a08cf81c33d65e48.tar.gz
libreboot-610711747339162004801b28a08cf81c33d65e48.tar.bz2
download script: re-factor. only have 1 loop for downloading
-rwxr-xr-xdownload21
1 files changed, 10 insertions, 11 deletions
diff --git a/download b/download
index 4860a58..bed0b64 100755
--- a/download
+++ b/download
@@ -24,20 +24,18 @@
set -u -e
download=./resources/scripts/helpers/download
-availableprogrammes=$(ls ${download}/)
+programmes="none"
case ${@} in
all)
- for programme in ${availableprogrammes}; do
- ${download}/${programme}
- done
+ programmes=$(ls ${download}/)
;;
list)
- printf "possible values for 'programmes':\nall:\n%s\n\n" "${availableprogrammes}"
+ printf "possible values for 'programmes':\nall:\n%s\n\n" "${programmes}"
;;
help)
printf "%s\n\n" "./download programme(s) # programmes are space separated, if specifing multiple programmes"
- printf "possible values for 'programmes':\nall:\n%s\n\n" "${availableprogrammes}"
+ printf "possible values for 'programmes':\nall:\n%s\n\n" "${programmes}"
printf "Example (download everything): ./download all\n"
printf "Example (download flashrom): ./download flashrom\n"
printf "Example (download coreboot): ./download coreboot\n"
@@ -46,11 +44,12 @@ case ${@} in
;;
*)
for programme in ${@}; do
- echo ${availableprogrammes} | grep -wq ${programme} || (printf "ERROR: Invalid programme '${programme}'. See ./download help.\n"; exit 1)
- done
- for programme in ${@}; do
- ${download}/${programme}
+ echo ${programmes} | grep -wq ${programme} || (printf "ERROR: Invalid programme '${programme}'. See ./download help.\n"; exit 1)
done
+ programmes=${@}
;;
esac
-# ------------------- DONE ----------------------
+
+for programme in ${programmes}; do
+ ${download}/${programme}
+done