fix(bin/linja): add '$' and ' ' cases to escape_ninja_char
This is related to #513
This commit is contained in:
parent
9fb44c1e93
commit
f72f4cf441
1 changed files with 3 additions and 2 deletions
|
@ -306,7 +306,7 @@ def find_file_upward(name, path = os.getcwd()):
|
|||
return None
|
||||
|
||||
def escape_ninja_char(name):
|
||||
return name.replace(":", "$:")
|
||||
return name.replace("$", "$$").replace(":", "$:").replace(" ", "$ ")
|
||||
|
||||
def normalize_drive_name(name):
|
||||
if platform.system() == "Windows":
|
||||
|
@ -679,10 +679,11 @@ def make_deps(lean_file, dlean_file, olean_file):
|
|||
deps = []
|
||||
proc = subprocess.Popen([g_lean_path, "--deps", lean_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
output = proc.communicate()[0]
|
||||
print(olean_file + ": \\", file=f)
|
||||
print(escape_ninja_char(olean_file) + ": \\", file=f)
|
||||
for olean_file in output.strip().splitlines():
|
||||
if olean_file:
|
||||
deps.append(normalize_drive_name(os.path.abspath(olean_file)))
|
||||
deps = map(escape_ninja_char, deps)
|
||||
deps_str = b" " + (b" \\\n ".join(deps))
|
||||
print(deps_str, file=f)
|
||||
|
||||
|
|
Loading…
Reference in a new issue