From 6f6a16cdd2a49f7b50e8b0d2b75ef768a323eee7 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 20 Feb 2014 10:51:27 +0100 Subject: Added WebDAV upload script for cadaver, fixed docs dir --- build.gradle | 2 +- davcpy.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 davcpy.sh diff --git a/build.gradle b/build.gradle index e8413256..b4812d04 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ def getCheckedOutGitCommitHash() { task docs(type: Javadoc) { source subprojects.collect {project -> project.sourceSets.main.allJava } classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) - destinationDir = new File(projectDir, 'docs') + destinationDir = new File(projectDir, 'docs/full') } diff --git a/davcpy.sh b/davcpy.sh new file mode 100755 index 00000000..99a47b6d --- /dev/null +++ b/davcpy.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +usage () { echo "$0 *" >/dev/stderr; } +error () { echo "$1" >/dev/stderr; usage; exit 1; } + +test $# '<' 3 || \ + error "Source and cadaver arguments expected!"; + +src="$1"; shift; +test -r "$src" || \ + error "Source argument should be a readable file or directory!"; + +cd "$(dirname "$src")"; +src="$(basename "$src")"; +root="$(pwd)"; +rc="$(mktemp)"; +{ + find "$src" '(' -type d -a -readable ')' \ + -printf 'mkcol "%p"\n'; + find "$src" '(' -type f -a -readable ')' \ + -printf 'cd "%h"\nlcd "%h"\n' \ + -printf 'mput "%f"\n' \ + -printf 'cd -\nlcd "'"$root"'"\n'; + echo "quit"; +} > "$rc"; + +cadaver -r "$rc" "$@"; +rm -f "$rc"; -- cgit v1.2.3