yo icon indicating copy to clipboard operation
yo copied to clipboard

Warn when running a generator in ~ or /

Open eddiemonge opened this issue 9 years ago • 13 comments

Might be good. Might be bad.

eddiemonge avatar Oct 07 '14 20:10 eddiemonge

Probably good. :)

I'd go further and throw and error and prevent the process from running.

SBoudrias avatar Oct 07 '14 20:10 SBoudrias

Prevent it. No reason to want it to happen.

sindresorhus avatar Oct 07 '14 21:10 sindresorhus

Unless your generator is generator-dotfiles. Why is that not a thing yet?

eddiemonge avatar Oct 07 '14 21:10 eddiemonge

If there is a module to know what the homedir is for a given environment I would also have it at the very least warn when running outside of it. Maybe not for windows. People seem to like their ability to put things all around the place and on different drives

Munter avatar Oct 07 '14 21:10 Munter

What is the homedir for windows? I feel like there is one but no windows user knows what it is

eddiemonge avatar Oct 07 '14 21:10 eddiemonge

http://en.wikipedia.org/wiki/Home_directory#Default_home_directory_per_operating_system

Munter avatar Oct 07 '14 21:10 Munter

This might be more on the generator authors but it should output where the destinationRoot folder is so people are aware as sort of a double check

eddiemonge avatar Oct 07 '14 21:10 eddiemonge

As I understand it there are some issues on windows with nested node_modules directories generating too long file names. Because obviously putting a limit on the length of a path is a good thing? Anyway, I've heard that as a specific reason for people putting their node projects in a short name folder directly in the root or on a separate drive

Munter avatar Oct 07 '14 21:10 Munter

https://github.com/sindresorhus/user-home

sindresorhus avatar Oct 07 '14 21:10 sindresorhus

I feel like this got implemented. @SBoudrias @sindresorhus yes no?

eddiemonge avatar Apr 28 '15 19:04 eddiemonge

I'm not sure, I think we just implemented an alert if there's a .yo-rc.json file in the user home dir.

SBoudrias avatar Apr 28 '15 20:04 SBoudrias

Hi! I would like to work on this.

hvardhanx avatar May 30 '16 15:05 hvardhanx

You're welcome to :).

kevva avatar Jun 01 '16 18:06 kevva