Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 62 lines (58 sloc) 1.465 kB
#!/usr/bin/env bash
sudo_args=()
while
(( $# ))
do
case "$1" in
(--trace)
export PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
set -o xtrace
;;
(--verbose)
set -o verbose
;;
(-*)
sudo_args+=("$1")
case "$1" in
(-g|-u|-p|-r|-t|-U|-C)
shift
sudo_args+=("${1:-}")
;;
esac
;;
(*)
break
;;
esac
(( $# == 0 )) || shift
done
if (( $# ))
then
eval command sudo \"\${sudo_args[@]}\" /usr/bin/env $(
/usr/bin/env |
awk -F= 'BEGIN{v=0;}/^[a-zA-Z_][a-zA-Z0-9_]*=/{v=1;}v==1&&$2~/^['\''\$]/{v=2;} v==1&&$2~/^\(\) \{/{v=0;} v==1&&$2~/^\(/{v=3;}v==2&&/'\''$/&&!/'\'\''$/{v=1;}v==3&&/\)$/{v=1;}v{print;}v==1{v=0;}' |
GREP_OPTIONS="" \grep -E '^rvm|^gemset|^http_|^PATH|^IRBRC|RUBY|GEM' |
sed 's/=\(.*\)$/="\1"/'
) \"\$@\" ||
{
result=$?
case $result in
(126)
printf "%b" "\nTarget user does not have access to the given command, try finding problem bellow:\n\n"
p="$rvm_path"
dirs=()
while
[[ "$p" != "" ]]
do
dirs+=( "$p" )
p="${p%/*}"
done
ls -ld "${dirs[@]}"
printf "%b" "\nIf you could not find the issue check permissions of all involved users and directories.\n\n"
;;
esac
exit $result
}
else
printf "%b" "Usage:\n $0 [--trace] [--verbose] [sudo-options] command [command-options]\n"
fi
Jump to Line
Something went wrong with that request. Please try again.