command: add command flag '--output=*' to set output directory

$ ./odroid-stamper --output=$PWD/output

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I9253d925cd406bb39c1486d4b1535c80bcf7e56a
This commit is contained in:
Dongjin Kim
2021-04-14 16:08:13 +09:00
parent 9e31949cde
commit e25e8d2d74

View File

@@ -2,6 +2,14 @@
#set -x
usage() {
echo "Usage: $(basename $0) [--help] [--output=<path>]"
echo
echo " --help: this help message"
echo " --output=<path>: output directory for image files."
exit 1
}
[ -z "$1" ] || CUSTOMOS=${1}
ODROID_STAMPER_DIR="/usr/share/odroid-stamper"
@@ -15,6 +23,17 @@ DEFAULT_CONFIG=${WORKDIR}/.config
download_dir="/var/cache/odroid-stamper/downloads"
out_dir=${WORKDIR}
for opt in "$@"; do
case $opt in
--help)
usage
;;
--output=*)
out_dir="${opt#*=}"
;;
esac
done
. ${TOPDIR}/menu
. ${TOPDIR}/default
. ${TOPDIR}/functions