Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle run in every system script

  • Loading branch information...
commit f803fb1c1b863f3b704e0b41c7cb9ca6de7b32a8 1 parent d0da36e
@mpapis mpapis authored
View
3  scripts/functions/requirements/arch
@@ -14,6 +14,9 @@ function requirements_arch()
command_to_run+=( $1 )
shift
;;
+ (run)
+ shift
+ ;;
(force)
command_flags+=( --noconfirm )
shift
View
3  scripts/functions/requirements/centos
@@ -14,6 +14,9 @@ function requirements_yum()
command_to_run+=( $1 )
shift
;;
+ (run)
+ shift
+ ;;
(force)
command_flags+=( -y )
shift
View
2  scripts/functions/requirements/gentoo
@@ -14,7 +14,7 @@ function requirements_gentoo()
command_to_run+=( $1 )
shift
;;
- (force)
+ (force|run)
shift
;;
(*)
View
2  scripts/functions/requirements/openindiana
@@ -14,7 +14,7 @@ function requirements_gentoo()
command_to_run+=( $1 )
shift
;;
- (force)
+ (force|run)
shift
;;
(*)
View
3  scripts/functions/requirements/opensuse
@@ -14,6 +14,9 @@ function requirements_zypper()
command_to_run+=( $1 )
shift
;;
+ (run)
+ shift
+ ;;
(force)
command_flags+=( -y )
shift
View
2  scripts/functions/requirements/osx
@@ -14,7 +14,7 @@ function requirements_brew()
command_to_run+=( $1 )
shift
;;
- (force)
+ (force|run)
shift
;;
(*)
View
2  scripts/functions/requirements/smartos
@@ -14,7 +14,7 @@ function requirements_gentoo()
command_to_run+=( $1 )
shift
;;
- (force)
+ (force|run)
shift
;;
(*)
View
2  scripts/functions/requirements/solaris
@@ -14,7 +14,7 @@ function requirements_gentoo()
command_to_run+=( $1 )
shift
;;
- (force)
+ (force|run)
shift
;;
(*)
View
3  scripts/functions/requirements/ubuntu
@@ -14,6 +14,9 @@ function requirements_apt()
command_to_run+=( $1 )
shift
;;
+ (run)
+ shift
+ ;;
(force)
command_flags+=( --quiet --yes )
shift
View
2  scripts/functions/requirements/unknown
@@ -9,7 +9,7 @@ function requirements_unknown()
(( $# ))
do
case "$1" in
- (echo)
+ (echo|run)
shift
;;
(force)
View
25 scripts/requirements
@@ -6,6 +6,27 @@ fi
__rvm_detect_system
+command_to_run=( echo )
+command_flags=()
+
+while
+ (( $# ))
+do
+ case "$1" in
+ (echo|run)
+ command_to_run=( $1 )
+ shift
+ ;;
+ (force)
+ command_flags+=( $1 )
+ shift
+ ;;
+ (*)
+ break
+ ;;
+ esac
+done
+
case ${1:-echo} in
(echo)
printf "%b" "Requirements for $_system_name/$_system_version/$_system_arch\n"
@@ -20,12 +41,12 @@ Additional Dependencies:
for _type in update-system rvm ruby jruby
do
printf "%b" "# For $_type:\n"
- bash "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/requirements/$_system_name" ${1:-echo} $_type
+ bash "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/requirements/$_system_name" "${command_to_run[@]}" "${command_flags[@]}" $_type
printf "%b" "\n"
done
;;
(run)
printf "%b" "Installing requirements for $_system_name/$_system_version/$_system_arch\n"
- bash "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/requirements/$_system_name" ${1:-echo} force update-system rvm ${2:-ruby}
+ bash "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/requirements/$_system_name" "${command_to_run[@]}" force update-system rvm ${1:-ruby}
;;
esac
Please sign in to comment.
Something went wrong with that request. Please try again.