Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit ac887f3

Browse files
cumurufrej
authored andcommitted
Make hg-fst-export.sh callable via a symbolic link
Calling hg-fast-export.sh via a symlink used to fail because the script would look for hg-fast-export.py in the symlink‘s directory. This patch adds symlink resolution using greadlink with a fallback to readlink in order to support MacOS. That way you can safely add a symlink to hg-fast-export.sh somewhere in you PATH. Fixes frej#93
1 parent 4bb50bb commit ac887f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hg-fast-export.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# Copyright (c) 2007, 2008 Rocco Rutte <pdmef@gmx.net> and others.
44
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
55

6-
ROOT="$(dirname "$(which "$0")")"
6+
READLINK="readlink"
7+
if command -v greadlink > /dev/null; then
8+
READLINK="greadlink" # Prefer greadlink over readlink
9+
fi
10+
ROOT="$(dirname "$($READLINK -f "$(which "$0")")")"
711
REPO=""
812
PFX="hg2git"
913
SFX_MAPPING="mapping"

0 commit comments

Comments
 (0)