From 97f9944ac4bafca9928d6daeb23d4c64a2859cfd Mon Sep 17 00:00:00 2001 From: "Wayne E. Seguin" Date: Mon, 6 Jun 2011 17:04:26 -0400 Subject: [PATCH] Bugfix, we have ruby at this point, might as well use it to generate a yaml output of the env ;). --- lib/rvm/shell/shell_wrapper.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/rvm/shell/shell_wrapper.sh b/lib/rvm/shell/shell_wrapper.sh index 8128864b5f..bb9c13f709 100644 --- a/lib/rvm/shell/shell_wrapper.sh +++ b/lib/rvm/shell/shell_wrapper.sh @@ -1,12 +1,9 @@ # Prints an epilog to a shell command. __rvm_show_command_epilog() { - local last_command_result="$?" + local _code="$?" echo "---------------RVM-RESULTS-START---------------" - echo " exit_status: \"$last_command_result\"" - echo " environment: $(ruby -rrubygems -ryaml -e 'puts YAML.dump(ENV.inspect)')" + ruby -rrubygems -ryaml -e \ + "puts YAML.dump({'environment' => ENV.to_hash, 'exit_status' => '${_code}'})" echo "----------------RVM-RESULTS-END----------------" - #\env | \sed \ - # -e "s#'#\\'#g" \ - # -e 's#"#\\"#g' \ - # -e "s#\\([^=]*\\)=\\(.*\\)# '\1': \"\2\"#" } +