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-react-app does not clean up directory after failed install on Windows #1671

Closed
Timer opened this issue Feb 27, 2017 · 3 comments
Closed
Milestone

Comments

@Timer
Copy link
Contributor

Timer commented Feb 27, 2017

When the CLI fails to create a new application, it should cleanup and delete the directory it had created.

Please help us fix this bug or resolve the test case!

https://github.com/facebookincubator/create-react-app/blob/master/tasks/e2e-installs.sh#L126-L130

@johann-sonntagbauer
Copy link
Contributor

I can take a look at that one (windows user :) )

@johann-sonntagbauer
Copy link
Contributor

johann-sonntagbauer commented Feb 28, 2017

first intention was right. On windows the create-react-app process is currently locking the directory and therefor the deletion operation will not perform anything.
Simple fix would be to introduce a process.chdir(path.resolve(root, '..')); before the fs.removeSync(path.join(root));

kinda ugly but works

@Timer
Copy link
Contributor Author

Timer commented Feb 28, 2017

Not ugly, thanks!

@Timer Timer closed this as completed Feb 28, 2017
@gaearon gaearon added this to the 0.9.3 milestone Feb 28, 2017
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants