# HG changeset patch # User Sascha Wilde # Date 1583405629 -3600 # Node ID 136dc9e528c41a1e77abafd2fad948257f45a485 # Parent 4bd4cd7d84299692fb6dd04384d82569f8a6107f Added option --extra_dir to upload-styles.sh script. This is intended to upload styles from other repositories in addition to the included ones. diff -r 4bd4cd7d8429 -r 136dc9e528c4 style-templates/upload-styles.sh --- a/style-templates/upload-styles.sh Thu Mar 05 11:26:31 2020 +0100 +++ b/style-templates/upload-styles.sh Thu Mar 05 11:53:49 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 "$datadir" -name "*.sld-template" -or -name "*.zip")) + files=($(find "$datadir" "${extra_dirs[@]}" \ + -name "*.sld-template" -or -name "*.zip")) fi for file in ${files[@]} do