question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Symlink following logic in src() seems wrong to me

See original GitHub issue

Basically, 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
phatedcommented, Apr 1, 2016

Published as 2.4.3 - many thanks to @xunnanxu

0reactions
phatedcommented, Mar 28, 2016

@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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found