From 40950a0b52926e9198f4057a55f17bbdf7aec2f8 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sat, 27 Feb 2016 19:10:28 +0000 Subject: [PATCH] add -- after readlink --- urchin | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/urchin b/urchin index 5fe0b8b..b7c3dc2 100755 --- a/urchin +++ b/urchin @@ -25,7 +25,7 @@ urchin_root() { orig="$1" fi - if test "$(readlink -f "$1")" = /; then + if test "$(readlink -f -- "$1")" = /; then # Stop traversing upwards at / if test -d "$orig"; then origdir="$orig" @@ -35,7 +35,7 @@ urchin_root() { echo "You need to create the .urchin directory in the root of your tests, maybe like this: - mkdir '$(readlink -f "$(remove_trailing_slash "$origdir")")/.urchin' + mkdir '$(readlink -f -- "$(remove_trailing_slash "$origdir")")/.urchin' " >&2 return 1 elif ! test -e "$current"; then @@ -70,8 +70,8 @@ escape_slashes() { } get_stdout_file() { - root="$(readlink -f "$(urchin_root "$1")")" - test_file="$(readlink -f "$1")" + root="$(readlink -f -- "$(urchin_root "$1")")" + test_file="$(readlink -f -- "$1")" eroot="$(escape_slashes "$root")" base="$(echo "$test_file" | sed "s/^$eroot/$eroot\/.urchin/")" if test -d "$1"; then @@ -373,9 +373,9 @@ if test -z "$I_AM_SOURCING_URCHIN_IN_A_TEST"; then # Run or present the Molly guard. if ! urchin_root "$1" > /dev/null; then exit 1 - elif basename "$(readlink -f "$(urchin_root "$1")")" | + elif basename "$(readlink -f -- "$(urchin_root "$1")")" | grep -Fi 'test' > /dev/null || $force; then - logfile="$(readlink -f "$(urchin_root "$1")/.urchin/.log")" + logfile="$(readlink -f -- "$(urchin_root "$1")/.urchin/.log")" printf '' > "$logfile" urchin_go "$1" "$shell_for_sh_tests" else