Skip to content

Commit

Permalink
Remove unnecessary basename and awk call (#15)
Browse files Browse the repository at this point in the history
* Remove unnecessary basename and awk call

* Replace `exit` with `return`
  • Loading branch information
kidonng authored Jul 6, 2021
1 parent 25d968e commit bf6636c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions conf.d/fish_apple_touchbar.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
# Source: https://github.com/jorgebucaran/fisher/issues/651#issuecomment-762808325
fish-apple-touchbar

# Expected value should be fish_apple_touchbar_install
set --local plugin_name_install (basename (status --current-filename) .fish)_install

# Expected value should be fish_apple_touchbar_uninstall
set --local plugin_name_uninstall (basename (status --current-filename) .fish)_uninstall

function __fish_apple_touchbar_install --on-event "$plugin_name_install"
function __fish_apple_touchbar_install --on-event "fish_apple_touchbar_install"
__fish_apple_touchbar_first_view
end

function __fish_apple_touchbar_uninstall --on-event "$plugin_name_uninstall"
function __fish_apple_touchbar_uninstall --on-event "fish_apple_touchbar_uninstall"
__fish_apple_touchbar_reset_bindings
functions --erase (functions --all | command awk '/^__fish_apple_touchbar/')
functions --erase (functions --all | string match --regex --entire '^__fish_apple_touchbar')
end
2 changes: 1 addition & 1 deletion functions/fish-apple-touchbar.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function fish-apple-touchbar
if not status is-interactive
exit 0
return 0
end
function __fish_apple_touchbar_first_view
function _bind_keys_function_1
Expand Down

0 comments on commit bf6636c

Please sign in to comment.