# HG changeset patch # User Sascha Wilde # Date 1583405739 -3600 # Node ID 43ada68487ca119d7e61c95d64ed25c5f259706d # Parent 136dc9e528c41a1e77abafd2fad948257f45a485# Parent 9d57c5765474a1dc48cc04a6680b1092514055cd Merged diff -r 9d57c5765474 -r 43ada68487ca style-templates/upload-styles.sh --- 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