Skip to content

Commit e49d60d

Browse files
committed
fix conversion script
1 parent 140173d commit e49d60d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ci/utilities/convert_msys_paths_to_win_paths.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,24 @@ def msys_to_windows_path(msys_path):
4343
print(f"Error converting path: {e}")
4444
return None
4545

46-
def should_convert(var_name: str,
46+
def should_convert(var: str,
47+
convert: list[str] | None,
4748
exclude: list[str] | None):
4849
"""Check the variable name against exclude list"""
49-
if exclude and var_name in exclude:
50+
if exclude and var in exclude:
5051
return False
52+
53+
if var in convert:
54+
return True
55+
56+
return False
5157

5258
def main(parsed_args: argparse.Namespace):
5359
converted_paths = {}
5460

55-
for var_value in parsed_args.convert:
56-
var, value = var_value.split("=")
61+
for var, value in os.environ.items():
5762
if not value or not should_convert(var,
63+
parsed_args.convert,
5864
parsed_args.exclude):
5965
continue
6066
converted_path = msys_to_windows_path(value)

0 commit comments

Comments
 (0)