From 3aa8592350b7e976c84d3cf5ecc263fd1bd0730d Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Wed, 17 Feb 2021 22:19:08 +0000 Subject: [PATCH] Use BASH to get Ruby version, not AWK No need for AWK there. By using just `read` (builtin), instead of AWK, this commit winds up being a considerable optimization. NOTE: The `_` is just commonly used to indicate junk; not used. --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 1f9f0b35..47be977f 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -420,7 +420,7 @@ function chruby_version_prompt { chruby_auto fi - ruby_version=$(ruby --version | awk '{print $1, $2;}') || return + read _ ruby_version _ <<< "$(ruby --version)" || return if ! chruby | grep -q '\*'; then ruby_version="${ruby_version} (system)"