Skip to content

Commit

Permalink
Merge pull request #6 from tupywebteam/fix-error-last-command
Browse files Browse the repository at this point in the history
Fix error last command
  • Loading branch information
ik11235 authored Mar 27, 2024
2 parents cb88b95 + 063b65f commit de8004e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions conf.d/wakatime.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
# see: https://github.com/ik11235/wakatime.fish
###

function __register_wakatime_fish_before_exec -e fish_preexec
function __register_wakatime_fish_before_exec -e fish_postexec
if set -q FISH_WAKATIME_DISABLED
return 0
end

set -l exec_command_str

set exec_command_str (echo $argv | cut -d ' ' -f1)

if test "$exec_command_str" = 'exit'
return 0
end

set -l PLUGIN_NAME "ik11235/wakatime.fish"
set -l PLUGIN_VERSION "0.0.3"
set -l PLUGIN_VERSION "0.0.4"

set -l project
set -l wakatime_path
Expand All @@ -31,5 +39,5 @@ function __register_wakatime_fish_before_exec -e fish_preexec
set project "Terminal"
end

$wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity (echo $history[1] | cut -d ' ' -f1) &> /dev/null&
$wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity "$exec_command_str" &> /dev/null&
end

0 comments on commit de8004e

Please sign in to comment.