Skip to content

configurable support for symlinks#66

Merged
Keats merged 1 commit intoKeats:masterfrom
ScottDillman:SD-SYMLINK
Dec 13, 2024
Merged

configurable support for symlinks#66
Keats merged 1 commit intoKeats:masterfrom
ScottDillman:SD-SYMLINK

Conversation

@ScottDillman
Copy link
Copy Markdown
Contributor

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.


// 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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

name = "Test template"
description = "A description"
kickstart_version = 1
symlinks = false
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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.

@Keats Keats merged commit a773aa4 into Keats:master Dec 13, 2024
@ScottDillman ScottDillman deleted the SD-SYMLINK branch December 13, 2024 21:55
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