@@ -33,8 +33,7 @@ export async function install(platform, ruby) {
3333 const rubyPrefix = `${ drive } :\\${ base } `
3434
3535 const [ hostedRuby , msys2 ] = await linkMSYS2 ( )
36- const newPath = setupPath ( msys2 , rubyPrefix )
37- core . exportVariable ( 'PATH' , newPath )
36+ setupPath ( msys2 , rubyPrefix )
3837
3938 if ( version . startsWith ( '2.2' ) || version . startsWith ( '2.3' ) ) {
4039 core . exportVariable ( 'SSL_CERT_FILE' , `${ hostedRuby } \\ssl\\cert.pem` )
@@ -62,7 +61,7 @@ async function linkMSYS2() {
6261 return [ latestHostedRuby , msys2 ]
6362}
6463
65- function setupPath ( msys2 , rubyPrefix ) {
64+ export function setupPath ( msys2 , rubyPrefix ) {
6665 let path = process . env [ 'PATH' ] . split ( ';' )
6766
6867 // Remove conflicting dev tools from PATH
@@ -71,11 +70,14 @@ function setupPath(msys2, rubyPrefix) {
7170 // Remove default Ruby in PATH
7271 path = path . filter ( e => ! e . match ( / \b R u b y \b / ) )
7372
74- // Add MSYS2 in PATH
75- path . unshift ( `${ msys2 } \\mingw64\\bin` , `${ msys2 } \\usr\\bin` )
73+ if ( msys2 ) {
74+ // Add MSYS2 in PATH
75+ path . unshift ( `${ msys2 } \\mingw64\\bin` , `${ msys2 } \\usr\\bin` )
76+ }
7677
7778 // Add the downloaded Ruby in PATH
7879 path . unshift ( `${ rubyPrefix } \\bin` )
7980
80- return path . join ( ';' )
81+ const newPath = path . join ( ';' )
82+ core . exportVariable ( 'PATH' , newPath )
8183}
0 commit comments