Add an option to follow symlinks in `io.cp`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, symlinks are just copied over to the destination when using io.cp, and there is no way to alter this behaviour. I'm essentially asking for the equivalent of cp -L, which would recursively dereference symbolic links.
I think this can be implemented as a followSymlinks option in CopyOptions, which defaults to false.
The current workarounds are either to shell out to cp directly or use shelljs if this functionality is desired. Currently, I work with a patched version of @actions/io which implements this in a way that works for my needs.
It would be great if this feature was supported out of the box. I'm happy to open a PR for this once it is formalized and accepted, provided I have the bandwidth.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the io.cp entry point and the CopyOptions definition, then trace how recursive copying currently handles symbolic links. Add the optional followSymlinks behavior with a default of false, and verify that enabled copying dereferences links recursively while the existing default preserves them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100