From e7d5ca4bf6f0c1712541ba1c05cb612d00f6bcf3 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Thu, 14 Jul 2016 10:20:46 +0300 Subject: [PATCH] Fix batch activation file for paths with parens --- hererocks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hererocks.py b/hererocks.py index 87151d7..55d54e2 100755 --- a/hererocks.py +++ b/hererocks.py @@ -120,7 +120,7 @@ activation_script_templates = { """, "deactivate-lua.bat": """ @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": """ if (test-path function:deactivate-lua) { @@ -149,7 +149,8 @@ def write_activation_scripts(): "LOCATION": opts.location, "LOCATION_DQ": opts.location.replace("\\", "\\\\").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: