Symlink following logic in src() seems wrong to me
See original GitHub issueBasically, the generated vinyl file base should be what’s set to to the symlink itself:
Say the src directory structure is like:
|-- foo
|-- bar -> baz
|-- baz
|-- qux.txt
the symlink should produce: ./target/foo/bar at the end with qux.txt in it if dest is set to target. In practice it doesn’t.
The reason is the file base should always be set to ./foo for anything linked by bar whereas the original recursive logic would produce foo/baz.
Such incorrect logic would yield a flattened file structure and empty directories at the end:
pipe(gulp.dest('target'))
the original logic would generate:
|-- target
|-- foo
|-- baz (empty)
|-- qux.txt
whereas the fixed logic generates:
|-- target
|-- foo
|-- bar
|-- qux.txt
I’ve opened a PR here: https://github.com/gulpjs/vinyl-fs/pull/131 Please check it out.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Git symbolic links in Windows - Stack Overflow
In Windows (MSysGit), the symbolic link is converted to a text file with a path to the file it points to. Instead, I'd...
Read more >Import doesn't follow symlinks (#4984) · Issues - GitLab
I've set a Symlink to my Pictures directory. Shotwell seems to support this - when I Import from Folder, and pick that directory, ......
Read more >Gulp.src() doesn't follow symlinks #1273 - GitHub
It seems to me that confusion comes from vinyl-fs 's resolveSymlink() which overwrites file name by recursively following symlinks.
Read more >Why doesn't my symbolic link work? - Super User
Symlinks tend to like full paths or relative to the link, otherwise they can often be looking for file-1.txt locally (oddly enough).
Read more >Tips for remembering the order of parameters for ln?
This feels counter-intuitive so I find that I'm always second-guessing myself. Does anyone have any tips to help me remember the correct order?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published as 2.4.3 - many thanks to @xunnanxu
@xunnanxu reviewed and commented.
@floscher yep, it will be in the gulp 4 release and in vinyl-fs sooner (which will be available through the gulp 4 branch)