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

Fix. Error when restarting and reading the directory with files #114

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

Leo5878
Copy link
Contributor

@Leo5878 Leo5878 commented Jun 8, 2024

fix

@JasonShin
Copy link
Owner

Thanks for this, let me give it a try

@JasonShin
Copy link
Owner

JasonShin commented Jun 10, 2024

Hi @Leo5878, thank you for your contribution - I was able to reproduce the issue that you have raised.

When the type is generated already in the target project path (also the generated file does not match the ignore rule)

  • it will go and pick up the type file at this point https://github.com/JasonShin/sqlx-ts/blob/main/src/main.rs#L49
  • but right after that line, we also run clear_single_ts_file_if_exists, which means it will immediately delete that exact file it has picked up
  • It makes sense to delete the target type file (before scanning the project path) if you are using --generate-path

I can add some tests after merging this

Congrats on your first contribution 🚀

@JasonShin JasonShin merged commit f27c6b0 into JasonShin:main Jun 10, 2024
17 checks passed
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

Successfully merging this pull request may close these issues.

2 participants