Skip to content

Commit 4cf2da5

Browse files
committed
fix(workflow): only execute utils and project_type in updates
1 parent 5affde4 commit 4cf2da5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/execute_sql_files.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ def main(project_type):
7171

7272
# Check if the updates directory exists and process it
7373
if os.path.isdir(updates_dir):
74-
for root, _, files in os.walk(updates_dir):
75-
for file in sorted(files):
76-
if file.endswith(".sql") and exclude_prefix not in file:
77-
file_path = os.path.join(root, file)
78-
execute_sql_file(conn, file_path)
74+
for subdir in sorted(os.listdir(updates_dir)):
75+
subdir_path = os.path.join(updates_dir, subdir)
76+
# Check if the updates subdirectory exists and process it
77+
if os.path.isdir(subdir_path):
78+
for root, dirs, files in os.walk(subdir_path):
79+
dirs[:] = [d for d in dirs if d in ['utils', f"{project_type}"]]
80+
for file in sorted(files):
81+
if file.endswith(".sql"):
82+
file_path = os.path.join(root, file)
83+
execute_sql_file(conn, file_path)
7984
else:
8085
print(f"Directory {updates_dir} does not exist")
8186

0 commit comments

Comments
 (0)