Skip to content

Commit

Permalink
- add warnings for running tasks which do not exist (catch typos) and…
Browse files Browse the repository at this point in the history
… when no files were matched in a files task job
  • Loading branch information
polymonster committed Oct 1, 2023
1 parent 3df44aa commit 56da609
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/pmbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ def get_task_files(config, task_name):
stripped.append((changed, output[1]))
pairs = stripped
pairs = filter_files(config, task_name, pairs)
if len(pairs) == 0:
print_warning(f"[warning] no files were matched for this task: {files_array}")
return pairs


Expand Down Expand Up @@ -1321,6 +1323,15 @@ def core_help(config, taskname, task_type):
def generate_build_order(config, config_all, all):
# filter tasks
runnable = []

# check for typos
for task in sys.argv[2:]:
if not task.startswith("-n"):
task = task.strip("-")
if task not in config:
print_warning(f"[warning] task '{task}' not found in config")

# add runnable tasks
for task_name in config.keys():
task = config[task_name]
if type(task) != dict:
Expand Down

0 comments on commit 56da609

Please sign in to comment.