Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bin/as.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ rreadlink() ( # Execute the function in a *subshell* to localize variables and t
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

if [ `command -v file` ] && [[ `command file $target` =~ broken ]]; then
echo 'Error:' `file $target`
return 1
fi

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
Expand Down Expand Up @@ -818,7 +823,9 @@ parse_arguments()
echo "2. Try to use different http port, for example: as.sh --telnet-port 9998 --http-port 9999"
exit 1
fi
elif [ -z ${TARGET_PID} ]; then
fi

if [ -z ${TARGET_PID} ]; then
# batch mode is enabled, no interactive process selection.
echo "Illegal arguments, the <PID> is required." 1>&2
return 1
Expand Down