Skip to content
Snippets Groups Projects
Commit 3af6d482 authored by Michael Gajda's avatar Michael Gajda :rat:
Browse files

Refactor and cleanup code

parent 40d474ed
No related branches found
No related tags found
No related merge requests found
......@@ -3,18 +3,21 @@
# 2017 Michael Gajda <draget@speciesm.net>
# See LICENSE for license information
TURL="https://cloud.foss-ag.de/public.php/webdav"
TUSER="7bm6b2A8zTdHBE4"
USAGE="$0 <FILE/DIR>"
# check parameter
: ${1?Usage: $USAGE}
# Target-dir will be repo and branch
DIR=$(basename ${TRAVIS_REPO_SLUG})-${TRAVIS_BRANCH}
[ -z $DIR ] && echo "$0: Could not find a Travis env" && exit 1
# Creating a directory with an recursive upload is not possible with curl, use helper-script
# Upload-dir will be <repo>-<branch>
UPLOADDIR=$(basename ${TRAVIS_REPO_SLUG})-${TRAVIS_BRANCH}
[ -z $UPLOADDIR ] && echo "$0: Could not find a Travis env" && exit 1
# Creating a directory recursively is not possible with curl, use helper-script
wget https://raw.githubusercontent.com/foss-ag/script_curl-dirup/v1.0.1/curl-dirup.sh -O curl-dirup.sh && chmod +x curl-dirup.sh
mkdir -p ${DIR} 2>/dev/null
cp -a $@ ${DIR}
mkdir -p $DIR 2>/dev/null
cp -a $@ $DIR
# Actual upload
./curl-dirup.sh https://cloud.foss-ag.de/public.php/webdav 7bm6b2A8zTdHBE4:$PDFPW ${DIR}
./curl-dirup.sh $TURL $TUSER:$PDFPW $DIR
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment