From 0b5a29bbd60bc65fd5c9377fece9ad3a14e2bb56 Mon Sep 17 00:00:00 2001 From: "Tom \"Ravi\" Hale" Date: Thu, 30 Aug 2018 18:42:41 +0700 Subject: [PATCH] Invoke readlink -f in a way which can succeed --- lib/git/shell_shortcuts.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh index 6c4a972..d7fb8c4 100644 --- a/lib/git/shell_shortcuts.sh +++ b/lib/git/shell_shortcuts.sh @@ -100,10 +100,10 @@ if ! ls --color=auto > /dev/null 2>&1; then fi # Test if readlink supports -f option, otherwise use perl (a bit slower) -if ! readlink -f > /dev/null 2>&1; then - _abs_path_command='perl -e "use Cwd "abs_path"; print abs_path(shift)"' +if ! readlink -f / > /dev/null 2>&1; then + _abs_path_command=(perl -e 'use Cwd abs_path; print abs_path(shift)') else - _abs_path_command="readlink -f" + _abs_path_command=(readlink -f) fi # Function wrapper around 'll'