Skip to content

Commit

Permalink
Refactor fish scripts for fisher (#11)
Browse files Browse the repository at this point in the history
* Uninstall: Rename file to conf.d/fish_apple_touchbar.fish

Follow fisher's recommended filename for file https://github.com/jorgebucaran/fisher/tree/56c629a3a9086f33eeae801598b2046cab9bea6b#event-system.

* Move init.fish to conf.d/plugin_name.fish

Follow fisher's recommendation jorgebucaran/fisher#651 (comment).

* Use long-format options in conf.d/fish_apple_touchbar.fish

Docs:
https://fishshell.com/docs/current/cmds/status.html
https://fishshell.com/docs/current/cmds/set.html
https://fishshell.com/docs/current/cmds/functions.html

* Move top-level fish functions to functions/

Follow fisher's recommendation jorgebucaran/fisher#651 (comment).

* Move functions/keybindings.fish to conf.d/fish_apple_touchbar.fish

Quote variables to fix fish linter error about missing argument for --on-event.
Follow fisher's recommended filename for file https://github.com/jorgebucaran/fisher/tree/56c629a3a9086f33eeae801598b2046cab9bea6b#event-system.

* Changelog: Document changes

* Conf.d: Fix install and uninstall events

Fixed typo in install function name.
Removed curly braces from variables, their values were including these—e.g. fish_apple_touchbar{_install}.

* Changelog: Document fixes

Disable markdownlint MD036 warning for specific line (exception).
  • Loading branch information
rodrigobdz authored Mar 2, 2021
1 parent 12f996a commit acd076e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- markdownlint-disable MD036 -->

**Types of changes**

- `Added` - new features.
Expand All @@ -13,6 +15,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `Fixed` - bug fixes.
- `Security` - vulnerabilities.

## [1.0.0]

### Changed

- Uninstall: Rename `conf.d/__fish_apple_touchbar_uninstall.fish` to `conf.d/fish_apple_touchbar.fish`
- Move `init.fish` to `conf.d/plugin_name.fish`
- Use long-format options in `conf.d/fish_apple_touchbar.fish`
- Move top-level fish functions to `functions/`
- Move `functions/keybindings.fish` to `conf.d/fish_apple_touchbar.fish`

### Fixed

- Fixed fisher install and uninstall event triggers
- Fixed fisher's [deprecation](https://github.com/jorgebucaran/fisher/issues/651) notice

## [Unreleased]

[unreleased]: https://github.com/rodrigobdz/fish-apple-touchbar/compare/...HEAD
[1.0.0]: https://github.com/rodrigobdz/fish_apple_touchbar/releases/tag/v1.0.0
6 changes: 0 additions & 6 deletions conf.d/__fish_apple_touchbar_uninstall.fish

This file was deleted.

18 changes: 18 additions & 0 deletions conf.d/fish_apple_touchbar.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Moved contents of init.fish here
# 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"
__fish_apple_touchbar_first_view
end

function __fish_apple_touchbar_uninstall --on-event "$plugin_name_uninstall"
__fish_apple_touchbar_reset_bindings
functions --erase (functions --all | command awk '/^__fish_apple_touchbar/')
end
File renamed without changes.
1 change: 0 additions & 1 deletion init.fish

This file was deleted.

1 change: 0 additions & 1 deletion key_bindings.fish

This file was deleted.

0 comments on commit acd076e

Please sign in to comment.