Fix batch activation file for paths with parens

This commit is contained in:
Peter Melnichenko 2016-07-14 10:20:46 +03:00
parent 81d0094d67
commit e7d5ca4bf6

View File

@ -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: