-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: variables in template file names #105
Conversation
7c637ce
to
cb04703
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a validator and a test to check what happens if variable tries to escape the file from project directory. For example if the README_FILE_NAME
variable equals ../../foo/bar
.
We can not allow files being generated/overwritten outside of the project context.
We could also add a failsafe to the saver function to make sure that the file does not try to escape |
b36b622
to
c5d8f5b
Compare
Added validation to saver. Should I still add check also for the interactive part or just consider passing invalid file name as a user being wiseass on purpose and it's OK to just fail during save? Validating the input would require quite a lot of context since just having |
Yeah I think it is fine to validate it only when saving. The validation is mainly meant for the user to protect from malicious recipe which tries to override /etc/passwd or similar |
Render variables to template file names too
c5d8f5b
to
8dba1aa
Compare
Render variables to template file names too