Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/update-website
diff options
context:
space:
mode:
authorSimon Doppler <dopsi@dopsi.ch>2018-05-08 10:01:52 +0200
committerSimon Doppler <dopsi@dopsi.ch>2018-05-08 10:01:52 +0200
commit94258a36c846e0532300345f2a61c964d4748931 (patch)
tree1bbadaad3a9c4810e1e0d57a5b2679d9bf49c775 /update-website
parent23c745adc087c0f042e384a9d5db86c9de208f94 (diff)
Allow override of directories with long options
Diffstat (limited to 'update-website')
-rwxr-xr-xupdate-website24
1 files changed, 24 insertions, 0 deletions
diff --git a/update-website b/update-website
index a7fd6a9..09bd403 100755
--- a/update-website
+++ b/update-website
@@ -16,6 +16,10 @@ usage() {
>&2 echo ' Set archiso-i686 magnet link to $link.'
>&2 echo ' --magnet-dual $link:'
>&2 echo ' Set archiso-dual magnet link to $link.'
+ >&2 echo ' --website-dir $dir:'
+ >&2 echo ' Set website-dir to $dir.'
+ >&2 echo ' --mirror-dir $dir:'
+ >&2 echo ' Set mirror-dir to $dir.'
[ -z "$1" ] && exit 1 || exit "$1"
}
@@ -24,6 +28,8 @@ eval set -- "$(
--long help \
--long magnet-i686: \
--long magnet-dual: \
+ --long mirror-dir: \
+ --long website-dir: \
-n "$(basename "$0")" -- "$@" || \
echo usage
)"
@@ -59,6 +65,24 @@ while [ $# -gt 0 ]; do
tr -d '\n' > \
"${tmp_dir}/magnet.dual"
;;
+ '--mirror-dir')
+ if [ -s "${tmp_dir}/mirror_dir.set" ]; then
+ printf 'Option %s given multiple times.\n' "$1"
+ usage
+ fi
+ shift
+ mirror_dir="$1"
+ echo "$mirror_dir" > "${tmp_dir}/mirror_dir.set"
+ ;;
+ '--website-dir')
+ if [ -s "${tmp_dir}/website_dir.set" ]; then
+ printf 'Option %s given multiple times.\n' "$1"
+ usage
+ fi
+ shift
+ website_dir="$1"
+ echo "$website_dir" > "${tmp_dir}/website_dir.set"
+ ;;
'--')
shift
break