Skip to content

Commit f27c6b0

Browse files
authored
Fix. Error when restarting and reading the directory with files (#114)
1 parent 666c924 commit f27c6b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ async fn main() -> Result<()> {
4444
let ext = &CLI_ARGS.ext;
4545

4646
info!("Scanning {:?} for SQLs with extension {:?}", source_folder, ext);
47+
48+
// If CLI_ARGS.generate_types is true, it will clear the single TS file so `execute` will generate a new one from scratch
49+
clear_single_ts_file_if_exists()?;
4750

4851
let files = scan_folder(source_folder, ext);
4952
if files.is_empty() {
@@ -54,9 +57,6 @@ async fn main() -> Result<()> {
5457
std::process::exit(0);
5558
}
5659

57-
// If CLI_ARGS.generate_types is true, it will clear the single TS file so `execute` will generate a new one from scratch
58-
clear_single_ts_file_if_exists()?;
59-
6060
for file_path in files.iter() {
6161
let (sqls, handler) = parse_source(file_path)?;
6262
let failed = execute(&sqls, &handler).await?;

0 commit comments

Comments
 (0)