aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/bin/sabredav
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bin/sabredav')
-rwxr-xr-x[l---------]vendor/bin/sabredav38
1 files changed, 37 insertions, 1 deletions
diff --git a/vendor/bin/sabredav b/vendor/bin/sabredav
index 3b5e4511d..73bfa6039 120000..100755
--- a/vendor/bin/sabredav
+++ b/vendor/bin/sabredav
@@ -1 +1,37 @@
-../sabre/dav/bin/sabredav \ No newline at end of file
+#!/usr/bin/env sh
+
+# Support bash to support `source` with fallback on $0 if this does not run with bash
+# https://stackoverflow.com/a/35006505/6512
+selfArg="$BASH_SOURCE"
+if [ -z "$selfArg" ]; then
+ selfArg="$0"
+fi
+
+self=$(realpath $selfArg 2> /dev/null)
+if [ -z "$self" ]; then
+ self="$selfArg"
+fi
+
+dir=$(cd "${self%[/\\]*}" > /dev/null; cd '../sabre/dav/bin' && pwd)
+
+if [ -d /proc/cygdrive ]; then
+ case $(which php) in
+ $(readlink -n /proc/cygdrive)/*)
+ # We are in Cygwin using Windows php, so the path must be translated
+ dir=$(cygpath -m "$dir");
+ ;;
+ esac
+fi
+
+export COMPOSER_BIN_DIR=$(cd "${self%[/\\]*}" > /dev/null; pwd)
+
+# If bash is sourcing this file, we have to source the target as well
+bashSource="$BASH_SOURCE"
+if [ -n "$bashSource" ]; then
+ if [ "$bashSource" != "$0" ]; then
+ source "${dir}/sabredav" "$@"
+ return
+ fi
+fi
+
+"${dir}/sabredav" "$@"