-
Notifications
You must be signed in to change notification settings - Fork 81
Feature request: Add post-command hook #87
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
Comments
Yes, this is an definitely interesting idea! I wonder a little if this is the best best way of doing this though. Adding a command that's run after each notes command is doable and would cover some cases, but not all cases - e.g. changes to the directory from commands run elsewhere, or even changes from How does this compare to implementing command triggers using entr? That would automatically run a command every time any file in the notes repo changes, for any reason, which would solve this problem a bit more generally and independently. Or are there cases where it's really the notes command being run that you're interested in, not the file changes themselves? |
Thanks for your enlightening comment! I agree that using some programs like I'm not sure whether my original idea is useful in some situations but it doesn't seem necessary now. Thank you again for your time! |
Hi, I recently found that running a command based on file changes may not always be a good idea. For example, if you are making a lot of changes, it's a good habit to save the file from time to time. In this case, it's better to wait until the editor exits and then run some git command because you don't want to commit the intermediate changes. AFAIK, the UNIX password manager |
Sure, that's a fair argument. Just to be clear, the idea is:
Yeah? That sounds reasonable to me I think, I'm open to a PR for this if you're keen. |
Yeah exactly. I think the modification commands also include I'm happy to submit a PR for this later. |
It would be nice to have some post-command hook in notes so that after executing a command, the user can run a custom script or command.
This idea is inspired by using git to manage the notes from #12. The easiest way to do that is to let the user handle all of this after running any command, so they can detect changes, commit them, and push them if they want.
One easy way to do that is to add an option like
POST_COMMAND
in the configurations. That would not bring any breaking changes as well.If it's a good idea, I'm happy to work on it and open a PR later.
Thanks
The text was updated successfully, but these errors were encountered: