Fix batch activation file for paths with parens
This commit is contained in:
parent
81d0094d67
commit
e7d5ca4bf6
@ -120,7 +120,7 @@ activation_script_templates = {
|
|||||||
""",
|
""",
|
||||||
"deactivate-lua.bat": """
|
"deactivate-lua.bat": """
|
||||||
@echo off
|
@echo off
|
||||||
if exist "#LOCATION#\\bin\\lua.exe" for /f "usebackq delims=" %%p in (`""#LOCATION#\\bin\\lua" "#LOCATION#\\bin\\get_deactivated_path.lua""`) DO set "PATH=%%p"
|
if exist "#LOCATION#\\bin\\lua.exe" for /f "usebackq delims=" %%p in (`""#LOCATION_PAREN#\\bin\\lua" "#LOCATION_PAREN#\\bin\\get_deactivated_path.lua""`) DO set "PATH=%%p"
|
||||||
""",
|
""",
|
||||||
"activate.ps1": """
|
"activate.ps1": """
|
||||||
if (test-path function:deactivate-lua) {
|
if (test-path function:deactivate-lua) {
|
||||||
@ -149,7 +149,8 @@ def write_activation_scripts():
|
|||||||
"LOCATION": opts.location,
|
"LOCATION": opts.location,
|
||||||
"LOCATION_DQ": opts.location.replace("\\", "\\\\").replace('"', '\\"'),
|
"LOCATION_DQ": opts.location.replace("\\", "\\\\").replace('"', '\\"'),
|
||||||
"LOCATION_SQ": opts.location.replace("'", "'\\''"),
|
"LOCATION_SQ": opts.location.replace("'", "'\\''"),
|
||||||
"LOCATION_NESTED_SQ": opts.location.replace("'", "'\\''").replace("'", "'\\''")
|
"LOCATION_NESTED_SQ": opts.location.replace("'", "'\\''").replace("'", "'\\''"),
|
||||||
|
"LOCATION_PAREN": re.sub("[&,=()]", "^\g<0>", opts.location)
|
||||||
}
|
}
|
||||||
|
|
||||||
for template_name in template_names:
|
for template_name in template_names:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user