Skip to content

Commit

Permalink
Small simplification of header path for file flag.
Browse files Browse the repository at this point in the history
(This code section likely to be replaced later, though.)
  • Loading branch information
cpsauer committed Jan 14, 2023
1 parent 19c7f70 commit 3c46728
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions refresh.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,10 @@ def _get_commands(target: str, flags: str):
if file_path.endswith(_get_files.source_extensions):
target_statment = f"inputs('{re.escape(file_path)}', {target_statment})"
else:
# For header file we try to find from hdrs and srcs to get the targets
# For header files we try to find from hdrs and srcs to get the targets
# Since attr function can't query with full path, get the file name to query
head, tail = os.path.split(file_path)
target_statment = f"let v = {target_statment} in attr(hdrs, '{tail}', $v) + attr(srcs, '{tail}', $v)"
fname = os.path.basename(file_path)
target_statment = f"let v = {target_statment} in attr(hdrs, '{fname}', $v) + attr(srcs, '{fname}', $v)"
aquery_args = [
'bazel',
'aquery',
Expand Down

0 comments on commit 3c46728

Please sign in to comment.