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.

Ability to create symlinks with vfs.symlink method

See original GitHub issue

This is a continuation of some discussion in gulp-symlink, see: https://github.com/ben-eb/gulp-symlink/issues/19, https://github.com/ben-eb/gulp-symlink/issues/23#issuecomment-62816263

As previously stated, the current way we are handling symlinks using a transform stream, as we would use for manipulating a file’s contents, isn’t ideal. As symlinks are part of the file system it would make sense to provide this support in vinyl-fs, and by extension, gulp.

Ideally, this allows us to:

  • Create symlinks with absolute or relative paths, depending on the user’s preference.
  • Utilise transforms already in the pipe, such as gulp-rename to both rename and create the new symlink.

I think an API such as this would be good:

gulp.task('symlink', function() {
    return gulp.src('path/to/file')
        .pipe(gulp.dest('dist', {
            symlink: 'relative' // or 'absolute'
        }));
});

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
OZZlEcommented, Dec 15, 2016

seems like with the current solution you cannot control where the symlink leads to “cwd, base, and path will be overwritten to match the folder”

The structure I have depends on the source file having a complete different folder structure than where the symlink should be placed inside. When I simply replaced gulp.dest() with vfs.symlink() it creates the symlink in the correct place but it leads to a non existing place.

I used gulp-rename to change the path but didn’t help.

0reactions
ben-ebcommented, Dec 28, 2014

Awesome. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

VFS3 and symlinks| JBoss.org Content Archive (Read Only)
What I question is why we need to force it. As long as all accesses to the file via URL use the same...
Read more >
How to Create Symbolic Links: A Comprehensive Guide
Create a symbolic link using the below syntax. This command creates the symlink in the current directory. ... Change symlink_name to your desired ......
Read more >
Implementing symlinks in a virtual file system - Stack Overflow
I'm working on a virtual file system which isn't disk based, kind of like /proc. Now I want to create a symlink within...
Read more >
What are Symbolic Links? Hard & Soft Symbolic ... - Komprise
Symbolic Links are file-system objects that point toward another file or folder. Learn more about how hard & soft symbolic links are used...
Read more >
Access windows symbolic link from linux cifs
Could you please clarify your question just a bit more, you said a windows symlink is what you are trying to mount? Was...
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