aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2018-03-30 22:18:01 +0200
committerEinhard Leichtfuß <alguien@respiranto.de>2018-03-30 22:18:01 +0200
commitbbc3e4cfa5c02ad3ff8dcd3b7a95e568ac434c6f (patch)
tree4672ed4584f39482bad2353f7c648a2857b84104
parent2a7eb7221b85af3f2c5141c3918ff1959566f55a (diff)
Do not `cd' to early
-rwxr-xr-xupdate.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/update.sh b/update.sh
index c36b556..6f2edde 100755
--- a/update.sh
+++ b/update.sh
@@ -1,9 +1,6 @@
#!/bin/bash
# usage: $0 dir [-u xyz-uvw|-ua|-uaf]
-cd "$1" || exit 1
-shift
-
typeset -a langs
langs=(
fra-deu deu-fra
@@ -50,12 +47,14 @@ prepare[deu-fra-bin]=\
function main
{
+ [ "$#" -gt 0 ] && cd "$1" || exit 1
+ shift
+
curl -sO http://freedict.org/freedict-database.json
init
handle_all src '' src "$@"
handle_all bin -bin dictd "$@"
- cleanup
}
function update