-
Notifications
You must be signed in to change notification settings - Fork 28
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
configurable support for symlinks #66
Conversation
@@ -95,7 +95,7 @@ impl Template { | |||
}; | |||
|
|||
// And now generate the files in the output dir given | |||
let walker = WalkDir::new(&start_path) | |||
let walker = WalkDir::new(&start_path).follow_links(definition.symlinks) |
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.
Should we follow them by default?
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.
I wasn't sure of the original intent so I left it disabled by default, but I'm all for having it be the default case as long as it handles cycles during the walk and it doesn't effect Windows users. I'll test and makes sure that it doesn't introduce any issues there and if not make it the default.
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.
Initially the use case was for templates to be self contained, eg a git repo so there was no real need for symlinks
@@ -200,6 +203,7 @@ mod tests { | |||
name = "Test template" | |||
description = "A description" | |||
kickstart_version = 1 | |||
symlinks = false |
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.
If we use an option, I'd rather have it follow_symlinks
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.
much more descriptive, agreed. I'll make that change.
Was recently shopping around for a good scaffolding tool for projects and found kickstart, the only feature missing for me was the ability to follow symlinks so I can share common files between templates. This simple PR adds the ability to follow symlinks as a template config parameter but does not change the default behavior.