mirror of
https://github.com/docker/cli.git
synced 2026-08-24 10:05:37 -05:00
scripts/with-go-mod.sh: simplify symlink comparison
Make sure the symlinks point to the same file; not if both are identical (absolute or relative symlink); it's only for suppressing the warning so not critical. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -17,14 +17,12 @@ create_symlink() {
|
||||
local target="$1"
|
||||
local link="$2"
|
||||
|
||||
if [ -L "$link" ] && [ "$(readlink "$link")" = "$target" ]; then
|
||||
# symlink already present; we're done
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -e "$link" ]; then
|
||||
# see https://superuser.com/a/196698
|
||||
if ! [ "$link" -ef "${ROOTDIR}/${target}" ]; then
|
||||
echo "$(basename "$0"): WARN: $link exists but is not the expected symlink!" >&2
|
||||
echo "$(basename "$0"): WARN: Using your version instead of our generated version -- this may misbehave!" >&2
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user