-
Notifications
You must be signed in to change notification settings - Fork 189
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
Overwrite when calling createSourceFile #273
Comments
Can you post a short snippet of code that shows the problem? It should be overwriting. |
Oh? It tells me:
I'm just creating a file, writing a function into it and then saving it with |
Oh ok. That makes sense. That error happens on createSourceFile (not on save). I’ll think about this... probably will add an options object as the third parameter. |
Oh, I didn't even notice where it happens. Sorry for the confusion and thanks! 😅 |
This will be in the next release (tomorrow evening probably Edit: Nevermind, need to finish the other issues in the version 10 milestone... sometime this week or next). const sourceFile = project.createSourceFile("/file.ts", "", { overwrite: true }); In the future, there will probably be more options. |
This is available now in 10.0.1. |
After a quick search, I've found that apparently this option was considered for some operations but not for all, such as
save
andsaveSync
. It would be nice if we could overwrite when saving a file.Seems to me like I have to manually delete the file, maybe there's another way?
The text was updated successfully, but these errors were encountered: