mirror of https://github.com/dense-analysis/ale
Fix #3115 - Fix environment variable quoting on Windows
This commit is contained in:
parent
ae1d051504
commit
e412fa34ff
|
@ -222,7 +222,7 @@ endfunction
|
||||||
" valid for cmd on Windows, or most shells on Unix.
|
" valid for cmd on Windows, or most shells on Unix.
|
||||||
function! ale#Env(variable_name, value) abort
|
function! ale#Env(variable_name, value) abort
|
||||||
if has('win32')
|
if has('win32')
|
||||||
return 'set ' . a:variable_name . '=' . ale#Escape(a:value) . ' && '
|
return 'set ' . ale#Escape(a:variable_name . '=' . a:value) . ' && '
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return a:variable_name . '=' . ale#Escape(a:value) . ' '
|
return a:variable_name . '=' . ale#Escape(a:value) . ' '
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Execute(ale#Env should produce the correct syntax):
|
Execute(ale#Env should produce the correct syntax):
|
||||||
if has('win32')
|
if has('win32')
|
||||||
AssertEqual 'set name=xxx && ', ale#Env('name', 'xxx')
|
AssertEqual 'set name=xxx && ', ale#Env('name', 'xxx')
|
||||||
AssertEqual 'set name="foo bar" && ', ale#Env('name', 'foo bar')
|
AssertEqual 'set "name=foo bar" && ', ale#Env('name', 'foo bar')
|
||||||
else
|
else
|
||||||
AssertEqual 'name=''xxx'' ', ale#Env('name', 'xxx')
|
AssertEqual 'name=''xxx'' ', ale#Env('name', 'xxx')
|
||||||
AssertEqual 'name=''foo bar'' ', ale#Env('name', 'foo bar')
|
AssertEqual 'name=''foo bar'' ', ale#Env('name', 'foo bar')
|
||||||
|
|
Loading…
Reference in New Issue