Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Correct Bash completion path in Makefile #452

Merged
merged 7 commits into from
Dec 29, 2024

Conversation

inkarkat
Copy link
Member

@inkarkat inkarkat commented Dec 28, 2024

Before submitting a pull request, please make sure the following is done:

The correct one is /usr/local/share/bash-completion/completions/todo.sh; previous adaptations away from the legacy /etc/bash_completion.d/todo location were incomplete, also due to duplication in the Makefile.

To verify that these steps succeed on the workflow runners.
This currently fails because of todotxt#451
… script (after 491979b)

There are so many instances of todo.sh that this is easy to miss. I'll make it more DRY.

(This corrects commit 491979b)
@inkarkat inkarkat force-pushed the 451-fix-bash-completion branch 2 times, most recently from 0395af6 to 96430e6 Compare December 28, 2024 08:52
@inkarkat inkarkat requested a review from karbassi December 28, 2024 08:53
Copy link

@ss-raicangu ss-raicangu left a comment

Choose a reason for hiding this comment

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

🙌 Thanks for the quick fix! Confirming that both sudo make install and sudo make uninstall works for me, including completion.

  • suggestion: Possibly worth leaving a comment about why ignoring errors from rmdir $(datarootdir) is acceptable. For example, # Cleaning up `datarootdir` if it only contains `todo.sh` completion. Otherwise, ignoring the error to allow `make uninstall` to finish.

[1] Pleasantly surprised that I'm able to approve/leave feedback.

Unlike the other directories, this is a shared one; if there are other (locally installed) completions, it's not empty and cannot be removed. But if we're the only / last locally installed completion, it's nice to clean it up.
Suppress errors and command failure so that "make uninstall" does not fail due to this inconsequential error.

Fixes todotxt#451
…pletions

/usr/share/bash-completion/bash_completion looks into /usr/[local/]share/bash-completion/completions/; the bash_completion.d is the legacy (statically sourced) location in /etc. This was overlooked when moving away from that.
That change also failed to update the default location in the readme. (But the override example in the readme already used the correct one?!)
…on for completion

Add a note that the legacy locations (now also consistently used for the completion script) are not recommended, just to illustrate how to override the default locations.
@inkarkat inkarkat force-pushed the 451-fix-bash-completion branch from 96430e6 to 5b8c3d6 Compare December 29, 2024 10:53
@inkarkat inkarkat merged commit b20f9b4 into todotxt:master Dec 29, 2024
2 checks passed
@inkarkat inkarkat deleted the 451-fix-bash-completion branch December 29, 2024 10:55
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.

make uninstall fails because it tries to rmdir non-empty bash_completion.d
3 participants