From b56bf65bb359d0224eea4e69487f2092d4381593 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Mon, 17 Jul 2023 17:54:00 +0800 Subject: [PATCH] feat: better version information For better issue digging, adding the git hash and datetime into version information. --- zsh-vi-mode.zsh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zsh-vi-mode.zsh b/zsh-vi-mode.zsh index fa0660b..4db8846 100644 --- a/zsh-vi-mode.zsh +++ b/zsh-vi-mode.zsh @@ -348,7 +348,8 @@ zvm_switch_keyword_history=() # Display version information function zvm_version() { - echo -e "$ZVM_NAME $ZVM_VERSION" + local git_info=$(git show -s --format="(%h, %ci)" 2>/dev/null) + echo -e "$ZVM_NAME $ZVM_VERSION $git_info" echo -e "\e[4m$ZVM_REPOSITORY\e[0m" echo -e "$ZVM_DESCRIPTION" } @@ -3624,9 +3625,6 @@ function zvm_system_report() { shell=zsh fi - # ZVM - local git_info=$(git show -s --format="(%h, %ci)" 2>/dev/null) - ################# # System Report ################# @@ -3634,7 +3632,7 @@ function zvm_system_report() { print - "- Operating system: ${os_info}" print - "- ZSH framework: ${(j:, :)zsh_framworks}" print - "- ZSH version: $($shell --version)" - print - "- ZVM version: ${ZVM_VERSION} ${git_info}" + print - "- ZVM version: $(zvm_version | head -n 1)" } # Load config by calling the config function