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

Add option to clear output directory (feature request) #41

Closed
zarusz opened this issue Dec 28, 2018 · 6 comments
Closed

Add option to clear output directory (feature request) #41

zarusz opened this issue Dec 28, 2018 · 6 comments

Comments

@zarusz
Copy link

@zarusz zarusz commented Dec 28, 2018

Hi,

While using the TypeGen.DotNetCli I noticed the output directory leaves old TS models for classes C# that were already deleted. Is it possible to add an option to the tgconfig.json to remove all files in output dir prior TS model generation?

Without that, we might keep on aggregating old TS models when people forget to remove them.

Thanks,

@jburzynski
Copy link
Owner

@jburzynski jburzynski commented Dec 28, 2018

Hi,

yes, TypeGen doesn't clear the directory. I'll add this functionality to backlog and release it in a future release.

In the meantime I guess chaining rm -r [dir] with dotnet typegen generate should probably work even in pre/post build events.

Cheers

@zarusz
Copy link
Author

@zarusz zarusz commented Dec 28, 2018

Hey,

Yes, the rm -r is what I've been thinking too, but having that in the tool would be more awesome.

Thanks!

@jburzynski
Copy link
Owner

@jburzynski jburzynski commented Dec 28, 2018

Yes, definitely, it will be in a future release.
Cheers

jburzynski added a commit that referenced this issue Jan 2, 2019
@jburzynski
Copy link
Owner

@jburzynski jburzynski commented Jan 2, 2019

I just released version 2.1.1, which adds the functionality to clear the output directory before generating new files. Seems to be working fine, but let me know in case of any problems.

@zarusz
Copy link
Author

@zarusz zarusz commented Jan 7, 2019

I just upgraded to 2.1.2, enabled the "clearOutputDirectory": true in tgconfig.json and it worked smooth 👍

One small suggestion is to maybe log the fact the directory is being cleaned in the build output. This might help folks reinforce that this option is actually enabled.

Once again, thanks!

@zarusz zarusz closed this Jan 7, 2019
@jburzynski
Copy link
Owner

@jburzynski jburzynski commented Jan 7, 2019

This might be worth adding in a future version. Glad it works! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants