-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Turn off following symlinks #2195
Comments
@kmkacpermajor thanks for filing this - can you provide some more concrete details? what exactly does your configuration and/or gomplate commandline look like? |
Sure,
Error: failed to gather templates for rendering: walkDir: ignore matching failed for.: applyPatterns: stat: stat test_link: no such file or directory. gomplate.config excludes:
- '*'
- '!*.tmpl'
inputDir: .
outputMap: |
{{ .in | strings.ReplaceAll ".tmpl" "" }} I'm on Ubuntu 22.04.1 LTS on WSL2, gomplate v4.1.0 |
I can see that it is a problem with xignore library. I think that if we operate only on files instead of links, then if the file doesn't exist it would be okay to mark it as unmatched. Workaround would be to just ignore (continue in for) non existing files. They won't appear neither in matchedFiles or unmatchedFiles, so that is probably not a great fix... |
Discussed in #2194
Originally posted by kmkacpermajor July 25, 2024
Hi,
Is it possible to turn off following symlinks in gomplate.config?
I have all files excluded except for !*.tmpl, and it still tries to follow symlinks (even though their names don't end with .tmpl).
Because files that symlinks should follow don't exist on my computer, gomplate ends with an error "failed to gather templates for rendering: walkDir: ignore matching failed for ../..: applyPatterns: stat: stat testSymlink: no such file or directory".
I can't seem to find an option to turn off following symlinks in gomplate.
If there would be a config option to change os.Stat() to os.Lstat(), it would be great.
It would read the information off of symlink, and then for my usage it would just be excluded.
The text was updated successfully, but these errors were encountered: