From 972498d4bf3e420d81c77dd3678cbd86ad77cafb Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 19 Oct 2011 13:45:55 -0500 Subject: [PATCH] ruby-package install --fail-silently --- libexec/ruby-package-install | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libexec/ruby-package-install b/libexec/ruby-package-install index 85ea4254..d06bd7e1 100755 --- a/libexec/ruby-package-install +++ b/libexec/ruby-package-install @@ -2,7 +2,7 @@ set -e usage() { - echo "usage: ruby-package install PACKAGE DESTINATION" >&2 + echo "usage: ruby-package install [--fail-silently] PACKAGE DESTINATION" >&2 exit 1 } @@ -18,6 +18,12 @@ cleanup_packages() { fi } +fail_silently="" +if [ "$1" = "--fail-silently" ]; then + fail_silently=1 + shift +fi + package="$1" if [ -z "$package" ]; then usage @@ -31,6 +37,10 @@ fi if [ -f "$package" ]; then package_file="$package" else + if [ -n "$fail_silently" ]; then + ruby-package fetch --check "$package" 2>/dev/null + fi + package_file="$(ruby-package fetch "$package")" fi