diff options
-rwxr-xr-x | create-temp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/create-temp b/create-temp index 5bbf475..95cde7f 100755 --- a/create-temp +++ b/create-temp @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (c) 2006 Peter Palfrader <peter@palfrader.org> # @@ -36,5 +36,9 @@ if ! [ -L "$TARGET" ] && [ -e "$TARGET" ]; then exit 1; fi +target_dir="$(dirname "$TARGET")" +if [ "${BASE##$target_dir/}" != "$BASE" ]; then + BASE="${BASE##$target_dir/}" +fi rm -f "$TARGET" ln -s "$BASE/$TODAY" "$TARGET" |