-
Notifications
You must be signed in to change notification settings - Fork 486
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] chezmoi source-path returns source directory path if used on file in exact directory #2977
Labels
bug
Something isn't working
Comments
if the file doesn't exist at all, $ cd "$(chezmoi target-path)"
$ mkdir TEST
$ chezmoi add --exact TEST/
$ chezmoi source-path TEST/file
chezmoi: TEST/file: not in source state |
This comment was marked as outdated.
This comment was marked as outdated.
Updated, and issue is still reproducible.
|
Thanks for testing with the latest version. #2980 should fix it. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Running
chezmoi source-path FILE
on a target file in anexact_
source directory returns the source-dir path, same as if no arguments were given.NOTE: this also affects
chezmoi edit FILE
.To reproduce
Expected behavior
One of:
/home/$USER/.local/share/chezmoi/source/exact_TEST/empty_file
chezmoi: TEST/file: not in source state
and error1
like other filesOutput of command with the
--verbose
flagSame as above
Output of
chezmoi doctor
Additional context
This affects my workflow because I shadow my editor (
vim
) with a function like this:which saves me from thinking about using
chezmoi edit
or ordinaryvim
. However, whenchezmoi edit
returns the source path, this results in my file being deleted, without a chance to edit it.For this purpose exactly, I would prefer if
source-path
returned an error, however that's my own issue and I can just add a check to ensure it's actually present in the source directory.The text was updated successfully, but these errors were encountered: