updated ruby_gem_install.sh

pull/2/head
Hari Sekhon 5 years ago
parent 2cbccf26ca
commit 64c8e3a747

@ -28,29 +28,40 @@ usage(){
exit 3
}
gems=""
for x in "$@"; do
if [ -f "$x" ]; then
echo "adding gems from file: $x"
gems="$gems $(sed 's/#.*//;/^[[:space:]]*$$/d' "$x")"
echo
else
gems="$gems $x"
fi
gems="$(tr ' ' ' \n' <<< "$gems" | sort -u | tr '\n' ' ')"
done
for x in "$@"; do
case "$1" in
for arg; do
case "$arg" in
-*) usage
;;
esac
done
gems=""
process_args(){
for arg; do
if [ -f "$arg" ]; then
echo "adding gems from file: $arg"
gems="$gems $(sed 's/#.*//;/^[[:space:]]*$$/d' "$arg")"
echo
else
gems="$gems $arg"
fi
done
}
if [ -n "${*:-}" ]; then
process_args "$@"
else
# shellcheck disable=SC2046
process_args $(cat)
fi
if [ -z "${gems// }" ]; then
usage
fi
gems="$(tr ' ' ' \n' <<< "$gems" | sort -u | tr '\n' ' ')"
echo "Installing Ruby Gems"
echo

Loading…
Cancel
Save