summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-09 14:54:25 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-09 14:54:25 +0200
commita97a3c7f0fc220529cdf47938eb0729ffc7bb5ab (patch)
tree8e89cb3cc54cdf6d5f4717fa6280d8ca5d61af32
parent82cc1279724dddf7b257a4da2a2b88d847153f3e (diff)
Really fix expand BASEDIR when creating config.
-rwxr-xr-xbin/vdirsyncer4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/vdirsyncer b/bin/vdirsyncer
index 1894ad9..2069807 100755
--- a/bin/vdirsyncer
+++ b/bin/vdirsyncer
@@ -2,7 +2,9 @@
set -eu
-BASEDIR="$(dirname "$0")/.."
+BASEDIR=$(realpath --no-symlinks $(dirname "$0/.."))
+SUBDIR=$(realpath --no-symlinks --relative-to="$HOME" --relative-base="$HOME" "$BASEDIR")
+[ "$HOME/$SUBDIR" != "$BASEDIR" ] || BASEDIR="~/$SUBDIR"
ACTION=${1:-sync}