Skip to content

Conversation

@gaelicWizard
Copy link
Contributor

Description

Clean up plugin/todo, add to clean_files.txt, and use _bash-it-component-item-is-enabled() in plugin/base.

Motivation and Context

Mostly just cleaning up, but alsö getting rid of that abomination in plugin/base.

How Has This Been Tested?

Tests pass locally and in CI.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard gaelicWizard changed the title Ling: plugin/todo Lint: plugin/todo Dec 29, 2021
@gaelicWizard gaelicWizard marked this pull request as ready for review December 29, 2021 17:58
@gaelicWizard gaelicWizard force-pushed the plugin-todo branch 4 times, most recently from 4a0871d to 174afba Compare December 31, 2021 06:59
@gaelicWizard gaelicWizard changed the title Lint: plugin/todo Plugin/todo: cleanup and simplify Dec 31, 2021
plugin/base: use `_bash-it-component-item-is-enabled()`
Move the test for whether `plugin/todo` is enabled inside the function, and remove the alias from there.

Alsö, respect `$XDG_STATE_HOME` and move the old `~/.t` file if it exists.
Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@NoahGorny NoahGorny merged commit 48a1ff7 into Bash-it:master Jan 7, 2022
@gaelicWizard gaelicWizard deleted the plugin-todo branch January 7, 2022 18:14
seefood added a commit to seefood/bash-it that referenced this pull request Oct 7, 2025
Renames `aliases/available/todo.txt-cli.aliases.bash` to
`aliases/available/todo.aliases.bash` to match the naming convention
expected by the interactive install script.

**Problem:**
The install script in `_bash-it-install-enable()` (install.sh:26) parses
alias filenames using the pattern:
```bash
just_the_name="${file_name%".${file_type}.bash"}"
```

This expects: `{name}.aliases.bash` → extracts `{name}`

But the file was named `todo.txt-cli.aliases.bash`, which when stripped
of `.aliases.bash` leaves `todo.txt-cli`, causing the install script
to fail to recognize it during interactive installation.

**Solution:**
Rename to `todo.aliases.bash` to match the convention used by:
- `todo.plugin.bash` ✅
- `todo.completion.bash` ✅

Now extracts correctly: `todo.aliases.bash` → `todo`

**Notes:**
- File content unchanged - already uses `$TODO` variable correctly
- These are thin wrappers for the external todo.txt-cli tool
- Users install todo.txt-cli separately: `brew install todo-txt`
- Official upstream: https://github.com/todotxt/todo.txt-cli

**Related Issues:**
- Fixes Bash-it#2314 (interactive install failure)
- Related to Bash-it#1693, Bash-it#1742, Bash-it#2005 (todo plugin cleanup history)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants