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

inDir deletes contents of directory before generation #86

Closed
scalvert opened this issue Mar 18, 2020 · 5 comments
Closed

inDir deletes contents of directory before generation #86

scalvert opened this issue Mar 18, 2020 · 5 comments

Comments

@scalvert
Copy link

Currently, the inDir method will delete the contents of the specified directory prior to the generator running.

https://github.com/yeoman/yeoman-test/blob/master/lib/index.js#L86

Can we add a flag to skip this defaulting to preserving the current behavior for backwards compatibility?

deleteDirContents = true

I assume we'd thread this through to https://github.com/yeoman/yeoman-test/blob/master/lib/index.js#L75

@mshima
Copy link
Member

mshima commented Mar 18, 2020

Can we add a flag to skip this defaulting to preserving the current behavior for backwards compatibility?

Which version didn’t delete?
I think cd is what you are looking for.

@scalvert
Copy link
Author

Sorry, my description wasn't good. I don't want it to delete the contents. I'm using fixturify-project to scaffold out a specific project structure, which I want to then run the generator against. So, I want to skip deleting directory contents. Probably skipCleanup is a better param name.

@mshima
Copy link
Member

mshima commented Mar 19, 2020

You should use cd method instead.
https://yeoman.github.io/yeoman-test/RunContext.html#cd

Update: you didn’t mean there was a behavior change.

@mshima mshima closed this as completed Mar 19, 2020
@mshima
Copy link
Member

mshima commented Mar 19, 2020

The feature request is already implemented.

@scalvert
Copy link
Author

Ugg you're right. I swear I tried this first. Let me try again!

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

2 participants