Skip to content

Commit

Permalink
Use let to combine attr query
Browse files Browse the repository at this point in the history
  • Loading branch information
xinzhengzhang committed Dec 24, 2022
1 parent 8e834df commit 4cac1f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion refresh.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def _get_commands(target: str, flags: str):
# For header file 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"attr(hdrs, '{tail}', {target_statment}) + attr(srcs, '{tail}', {target_statment})"
target_statment = f"let v = {target_statment} in attr(hdrs, '{tail}', $v) + attr(srcs, '{tail}', $v)"
aquery_args = [
'bazel',
'aquery',
Expand Down

0 comments on commit 4cac1f6

Please sign in to comment.