Skip to content

Commit

Permalink
support non-executable files during pipeline setup (#10684)
Browse files Browse the repository at this point in the history
If a file in the pipeline setup scripts directory starts with an underscore, then it is treated as a "non-executable" file and it will not be executed.

This is required for #10637 where a large SQL setup script is needed to be referenced by one of the other scripts, but the SQL script itself must not be executed.
  • Loading branch information
djova committed Nov 19, 2021
1 parent 7ec881f commit 1e2abac
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ def setup(checks, changed):
echo_debug(f"Skip! No scripts for check `{check}` and platform `{cur_platform}`")
continue

scripts = sorted(os.listdir(os.path.join(check_scripts_path, cur_platform)))
echo_info(f'Setting up: {check} with these config scripts: {scripts}')
setup_files = sorted(os.listdir(os.path.join(check_scripts_path, cur_platform)))
scripts = [s for s in setup_files if not s.startswith("_")]
non_exe = [s for s in setup_files if s.startswith("_")]
non_exe_msg = f" (Non-executable setup files: {non_exe})" if non_exe else ""
echo_info(f'Setting up: {check} with these config scripts: {scripts}{non_exe_msg}')

for script in scripts:
script_file = os.path.join(check_scripts_path, cur_platform, script)
Expand Down

0 comments on commit 1e2abac

Please sign in to comment.