aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2016-03-10 19:19:57 +0000
committerFrancis Rowe <info@gluglug.org.uk>2016-03-10 19:22:38 +0000
commit2628a25901d35bd267fba945100864578f920770 (patch)
tree04f8e4154447422f4cc1a615ec4d09e078dd66cb
parenteea45e77dc0eb2f477e911a590c35d5f2275b1a6 (diff)
downloadlibrebootfr-2628a25901d35bd267fba945100864578f920770.tar.gz
librebootfr-2628a25901d35bd267fba945100864578f920770.zip
build: re-introduce variable names for $1 and $2
This is necessary, so that we can use "shift 2", so that additional parameters can be added which are passed to the scripts that the build script then calls.
-rwxr-xr-xbuild23
1 files changed, 13 insertions, 10 deletions
diff --git a/build b/build
index f1b94722..069d6526 100755
--- a/build
+++ b/build
@@ -63,25 +63,28 @@ if [ ${#} -eq 0 ] || [ ${#} -ge 4 ]; then
die "Wrong number of arguments specified. See './build help'."
fi
+mode="${1}"
+option="${2}"
+shift 2
-[ "${1}" = help ] && help && exit 0
+[ "${mode}" = help ] && help && exit 0
-case "${2}" in
+case "${option}" in
list)
- printf "Available options for mode '%s':\n\n" "${1}"
- listoptions "${1}"
+ printf "Available options for mode '%s':\n\n" "${mode}"
+ listoptions "${mode}"
;;
all)
- for option in $(listoptions "${1}"); do
- "${build}"/"${1}"/"${2}" "$@"
+ for option in $(listoptions "${mode}"); do
+ "${build}"/"${mode}"/"${option}" "$@"
done
;;
*)
- if [ -d "${build}"/"${1}"/ ]; then
- if [ -f "${build}"/"${1}"/"${2}" ]; then
- "${build}"/"${1}"/"${2}" "$@"
+ if [ -d "${build}"/"${mode}"/ ]; then
+ if [ -f "${build}"/"${mode}"/"${option}" ]; then
+ "${build}"/"${mode}"/"${option}" "$@"
else
- die "Invalid option for '${1}'. See './build ${1} list'."
+ die "Invalid option for '${mode}'. See './build ${mode} list'."
fi
else
die "Invalid mode. See './build help'."