From 01c4e55ae1a62749ea07f9cc66202115274b2912 Mon Sep 17 00:00:00 2001 From: Alexandr Shavykin Date: Sun, 10 Sep 2023 16:26:27 +0300 Subject: [PATCH 1/2] Update bash-wakatime.sh --- bash-wakatime.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash-wakatime.sh b/bash-wakatime.sh index 2c66cbd..bdbbd39 100644 --- a/bash-wakatime.sh +++ b/bash-wakatime.sh @@ -13,8 +13,8 @@ pre_prompt_command() { version="1.0.0" entity=$(echo $(fc -ln -0) | cut -d ' ' -f1) [ -z "$entity" ] && return # $entity is empty or only whitespace - $(git rev-parse --is-inside-work-tree 2> /dev/null) && local project="$(basename $(git rev-parse --show-toplevel))" || local project="Terminal" - (~/.wakatime/wakatime-cli --write --plugin "bash-wakatime/$version" --entity-type app --project "$project" --entity "$entity" 2>&1 > /dev/null &) + git rev-parse --is-inside-work-tree &> /dev/null && local project="$(basename "$(git rev-parse --show-toplevel)")" || local project="Terminal" + (~/.wakatime/wakatime-cli --write --plugin "bash-wakatime/$version" --entity-type app --project "$project" --entity "$entity" &> /dev/null &) } PROMPT_COMMAND="pre_prompt_command; $PROMPT_COMMAND" From 7b8866e8f4f1acf90bd998e3a0168e8facb433e2 Mon Sep 17 00:00:00 2001 From: Alexandr Shavykin Date: Sun, 10 Sep 2023 16:46:04 +0300 Subject: [PATCH 2/2] Update bash-wakatime.sh --- bash-wakatime.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash-wakatime.sh b/bash-wakatime.sh index bdbbd39..a7c3945 100644 --- a/bash-wakatime.sh +++ b/bash-wakatime.sh @@ -11,6 +11,7 @@ # hook function to send wakatime a tick pre_prompt_command() { version="1.0.0" + # shellcheck disable=SC2046,SC2005 entity=$(echo $(fc -ln -0) | cut -d ' ' -f1) [ -z "$entity" ] && return # $entity is empty or only whitespace git rev-parse --is-inside-work-tree &> /dev/null && local project="$(basename "$(git rev-parse --show-toplevel)")" || local project="Terminal"