Skip to content

Commit

Permalink
refactor: simplify control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Realiserad committed Apr 6, 2024
1 parent 14bf669 commit 1046501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions functions/_fish_ai_codify_or_explain.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function _fish_ai_codify_or_explain --description "Transform a command into a co

if test (string sub --length 2 "$input") = "# "
set output (_fish_ai_codify "$input")
commandline --replace "$output"
else
set output (_fish_ai_explain "$input")
commandline --replace "# $output"
end

commandline --replace "$output"

if test "$output" = "$input"
set -g status_emoji ''
else
Expand Down
2 changes: 1 addition & 1 deletion functions/_fish_ai_explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_messages():
try:
engine.get_logger().debug('Explaining commandline: ' + commandline)
response = engine.get_response(messages=get_messages())
print(response)
print('# ' + response)
except KeyboardInterrupt:
pass
except Exception as e:
Expand Down

0 comments on commit 1046501

Please sign in to comment.