Skip to content

Commit 3c46728

Browse files
committed
Small simplification of header path for file flag.
(This code section likely to be replaced later, though.)
1 parent 19c7f70 commit 3c46728

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

refresh.template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,10 +871,10 @@ def _get_commands(target: str, flags: str):
871871
if file_path.endswith(_get_files.source_extensions):
872872
target_statment = f"inputs('{re.escape(file_path)}', {target_statment})"
873873
else:
874-
# For header file we try to find from hdrs and srcs to get the targets
874+
# For header files we try to find from hdrs and srcs to get the targets
875875
# Since attr function can't query with full path, get the file name to query
876-
head, tail = os.path.split(file_path)
877-
target_statment = f"let v = {target_statment} in attr(hdrs, '{tail}', $v) + attr(srcs, '{tail}', $v)"
876+
fname = os.path.basename(file_path)
877+
target_statment = f"let v = {target_statment} in attr(hdrs, '{fname}', $v) + attr(srcs, '{fname}', $v)"
878878
aquery_args = [
879879
'bazel',
880880
'aquery',

0 commit comments

Comments
 (0)