We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47f7eb2 commit 1a339b0Copy full SHA for 1a339b0
bin/as.sh
@@ -45,6 +45,11 @@ rreadlink() ( # Execute the function in a *subshell* to localize variables and t
45
{ \unalias command; \unset -f command; } >/dev/null 2>&1
46
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.
47
48
+ if [[ `command file $target` =~ broken ]]; then
49
+ echo 'Error:' `file $target`
50
+ return 1
51
+ fi
52
+
53
while :; do # Resolve potential symlinks until the ultimate target is found.
54
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
55
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
0 commit comments