File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ def disable_msys_apps(mingwarch=nil)
129
129
130
130
def msys_apps_envvars_for_cmd
131
131
vars = with_msys_install_hint { msys_apps_envvars }
132
+ if ( path = vars . delete ( "PATH" ) ) && !ENV [ 'PATH' ] . include? ( path )
133
+ vars [ 'PATH' ] = path + ";" + ENV [ 'PATH' ]
134
+ end
132
135
vars . map do |key , val |
133
136
"#{ key } =#{ val } "
134
137
end . join ( "\n " )
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ class TestRubydevkit < Minitest::Test
5
5
def test_rubydevkit_without_params
6
6
skip unless File . directory? ( "C:/msys64" )
7
7
8
+ old = ENV [ 'PATH' ]
9
+ ENV [ 'PATH' ] += ";c:\\ testpath"
8
10
out = Tempfile . open ( %w[ test .cmd ] ) do |fd |
9
11
fd . write <<-EOT
10
12
@call rubydevkit
@@ -16,7 +18,8 @@ def test_rubydevkit_without_params
16
18
end
17
19
18
20
mingw = RUBY_PLATFORM =~ /x64/ ? "MINGW64" : "MINGW32"
19
- assert_match ( /PATH: .*;C:\\ msys64\\ #{ mingw } \\ bin;C:\\ msys64\\ usr\\ bin/i , out )
21
+ assert_match ( /PATH: .*;C:\\ msys64\\ #{ mingw } \\ bin;C:\\ msys64\\ usr\\ bin.*c: \\ testpath$ /i , out )
20
22
assert_match ( /MSYSTEM: #{ mingw } /i , out )
23
+ ENV [ 'PATH' ] = old
21
24
end
22
25
end
You can’t perform that action at this time.
0 commit comments