diff options
-rw-r--r-- | build.gradle | 2 | ||||
-rwxr-xr-x | davcpy.sh | 28 |
2 files changed, 29 insertions, 1 deletions
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 <src> <cadaver-args>*" >/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"; |