changeset 4987:43ada68487ca

Merged
author Sascha Wilde <wilde@intevation.de>
date Thu, 05 Mar 2020 11:55:39 +0100
parents 136dc9e528c4 (diff) 9d57c5765474 (current diff)
children 61eb65394a13
files
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/style-templates/upload-styles.sh	Thu Mar 05 11:50:24 2020 +0100
+++ b/style-templates/upload-styles.sh	Thu Mar 05 11:55:39 2020 +0100
@@ -29,6 +29,8 @@
   -P, --g_port=GPORT  connect to gemma server at GPORT. Default 8000.
   -g, --g_host=GHOST  connect to gemma server on GHOST. Default "localhost".
   -u, --g_user=GUSER  login to gemma as user GUSER. Default "sophie".
+  -d, --extra_dir=DIR search DIR in addition to the default styles directory.
+                      This option can be specified multiple times.
       --g_pw=GPW      password for GUSER. Default "so2Phie4".
       --help          display this help and exit
 
@@ -47,12 +49,13 @@
 g_host="localhost"
 g_user="sophie"
 g_pw="so2Phie4"
+declare -a extra_dirs
 
 # Parse options:
 
 OPTS=`getopt \
-      -l help,g_port:,g_host:,g_user:,g_pw: \
-      -o P:g:u: -n "$ME" -- "$@"`
+      -l help,g_port:,g_host:,g_user:,g_pw:,extra_dir: \
+      -o P:g:u:d: -n "$ME" -- "$@"`
 [ $? -eq 0 ] || { usage ; exit 1 ; }
 
 eval set -- "$OPTS"
@@ -75,6 +78,10 @@
       g_pw="$2"
       shift 2
       ;;
+    --extra_dir|-d)
+      extra_dirs+=("$2")
+      shift 2
+      ;;
     --help)
       { usage ; exit 0 ; }
       ;;
@@ -109,7 +116,8 @@
   if [ $# -gt 0 ]; then
     files=("$@")
   else
-    files=($(find . -name "*.sld-template" -or -name "*.zip"))
+    files=($(find "$datadir" "${extra_dirs[@]}" \
+                  -name "*.sld-template" -or -name "*.zip"))
   fi
   for file in ${files[@]}
   do