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

init is copying into a blueprint/ subdir on Windows #14

Open
insin opened this issue Feb 25, 2016 · 0 comments
Open

init is copying into a blueprint/ subdir on Windows #14

insin opened this issue Feb 25, 2016 · 0 comments

Comments

@insin
Copy link

insin commented Feb 25, 2016

shelljs' cp() is checking for a source path ending with '/' before adding a wildcard to it, but as the blueprint directory is built with path.join(), it will be in Windows '\' format by the time shelljs gets it.

Manually adding a wildcard to the blueprint path from react-project's end of things doesn't work as a fix, as cp() will try to fs.statSync() it, which blows up with ENOENT on Windows.

I've got it working by manually tweaking the path separator cp() is checking for in react-project's node_modules/, but tweaking cp() to handle platform-normalised input paths properly would be a bigger, less fun job.

I've found copy-template-dir useful for this task cross-platform before - it also handles stripping a leading '_' from file names when copying, so blueprint dotfiles and package.json won't get picked up at unwanted times (e.g. npm will find and usefiles config in package.json at any level in your project when publishing). This could also be a potential fix for #8

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

1 participant