Skip to content

Commit

Permalink
Suport exclude keys
Browse files Browse the repository at this point in the history
  • Loading branch information
colin4124 committed Feb 24, 2022
1 parent c26edda commit 2016de8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scratchip/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,16 @@ def gen_filelist(self, cfg_path, dest_target):
targets[target] = filesets + targets[target]

# Remove specified line by keyword
def remove_line(key_list, line):
for k in key_list:
if k in line:
return []
return line
for target, v in cfg["filelist"].items():
if "exclude" in v:
result = []
for line in targets[target]:
if v["exclude"] not in line:
result += line
result += remove_line(v["exclude"], line)
targets[target] = result

dest_dir = "builds/filelist"
Expand Down

0 comments on commit 2016de8

Please sign in to comment.