summaryrefslogtreecommitdiffstats
path: root/bin/comics/geekandpoke
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2012-07-27 14:37:51 +0200
committerwww-data <www-data@vm-staticweb.spline.inf.fu-berlin.de>2012-07-27 14:37:51 +0200
commit676e7ac3abb5eb9d956a702adec2a21b97cb4ed6 (patch)
treea79dec9a9b78a743054b8a277a0668891ed65756 /bin/comics/geekandpoke
parent0783f3e5a0b48bb61e436aa3b0c418f7506ba296 (diff)
downloadcomics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.tar.gz
comics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.tar.bz2
comics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.zip
bin: supply top directory to fetch scripts
If calling get-commics with absolute pathe the fetching scripts got something like /var/www/comics.spline.de//var/www/comics.spline.de/ as absolute path. This fixes this issue by changing the working directory to the top level directory and getting the path with $(pwd) one time and supply the top directory to the fetching scripts as first argument.
Diffstat (limited to 'bin/comics/geekandpoke')
-rwxr-xr-xbin/comics/geekandpoke10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/comics/geekandpoke b/bin/comics/geekandpoke
index d9e46bc..11c4360 100755
--- a/bin/comics/geekandpoke
+++ b/bin/comics/geekandpoke
@@ -1,6 +1,14 @@
#!/bin/bash
-source $(pwd)/$(dirname $0)/../../etc/settings.sh
+if [ -z "$1" -o ! -d "$1" ]; then
+ echo "Usage: $0 <top-directory> [<days ago>]" 1>&2
+ exit 1
+fi
+
+top="${1}"
+shift
+
+source "${top}/etc/settings.sh"
tmp="$(mktemp -d)"
cd "${tmp}"