Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create symlink from within the generator #547

Closed
mulderp opened this issue May 1, 2014 · 6 comments
Closed

Create symlink from within the generator #547

mulderp opened this issue May 1, 2014 · 6 comments

Comments

@mulderp
Copy link

mulderp commented May 1, 2014

Hi,

I am seeing:

    this.mkdir('app/node_modules');

but how could I create symlinks into that directory?

Thanks!

@eddiemonge
Copy link
Member

Why would you want to? Symlinks dont work the same everywhere

@mulderp
Copy link
Author

mulderp commented May 5, 2014

With symlinks, it is possible to require(someModule) in Node/browserify projects. Sure, symlinks on Windows might behave different from *nix, but an option to setup symlinks would still be great as far as I can see.

@eddiemonge
Copy link
Member

Sorry but can you give me a specific example of why the symlink is needed? You don't need symlinks to require things normally.

@mulderp
Copy link
Author

mulderp commented May 5, 2014

It's for this generator: https://github.com/mulderp/generator-backbone-browserify

if you have a collection in app/collections/foo a symlink can help to require('collections/foo') from different locations in an app

@SBoudrias
Copy link
Member

Hey, I don't think this is a largely needed feature we'll add to the core.

Although, note this is easily feasible using pure Node.js with the fs.symlink() method. Using the yeoman file-system utils you'll be able to easily resolve paths within a generated project to consume by the node method.

@cueedee
Copy link

cueedee commented Aug 3, 2016

Well, I needed this feature and so took up the task suggested; the result of which can be found in this gist for whoever wants it too.

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

No branches or pull requests

4 participants