Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ScottDillman
Copy link

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.

@@ -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)
Copy link
Owner

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?

Copy link
Author

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.

Copy link
Owner

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
Copy link
Owner

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

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants