@@ -82,6 +82,22 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
8282 return engine + '-' + version
8383}
8484
85+ function setupPath ( ruby , newPathEntries ) {
86+ const originalPath = process . env [ 'PATH' ] . split ( path . delimiter )
87+ let cleanPath = originalPath . filter ( e => ! / \b r u b y \b / i. test ( e ) )
88+
89+ if ( cleanPath . length !== originalPath . length ) {
90+ console . log ( "Entries removed from PATH to avoid conflicts with Ruby:" )
91+ for ( const entry of originalPath ) {
92+ if ( ! cleanPath . includes ( entry ) ) {
93+ console . log ( ` ${ entry } ` )
94+ }
95+ }
96+ }
97+
98+ core . exportVariable ( 'PATH' , [ ...newPathEntries , ...cleanPath ] . join ( path . delimiter ) )
99+ }
100+
85101function getVirtualEnvironmentName ( ) {
86102 const platform = os . platform ( )
87103 if ( platform === 'linux' ) {
@@ -105,20 +121,4 @@ function findUbuntuVersion() {
105121 }
106122}
107123
108- function setupPath ( ruby , newPathEntries ) {
109- const originalPath = process . env [ 'PATH' ] . split ( path . delimiter )
110- let cleanPath = originalPath . filter ( e => ! / \b r u b y \b / i. test ( e ) )
111-
112- if ( cleanPath . length !== originalPath . length ) {
113- console . log ( "Entries removed from PATH to avoid conflicts with Ruby:" )
114- for ( const entry of originalPath ) {
115- if ( ! cleanPath . includes ( entry ) ) {
116- console . log ( ` ${ entry } ` )
117- }
118- }
119- }
120-
121- core . exportVariable ( 'PATH' , [ ...newPathEntries , ...cleanPath ] . join ( path . delimiter ) )
122- }
123-
124124run ( )
0 commit comments