@@ -12,7 +12,7 @@ const linuxOSInfo = require('linux-os-info')
12
12
13
13
export const windows = ( os . platform ( ) === 'win32' )
14
14
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
15
- export const drive = ( windows ? ( process . env [ 'GITHUB_WORKSPACE ' ] || 'C' ) [ 0 ] : undefined )
15
+ export const drive = ( windows ? ( process . env [ 'RUNNER_TEMP ' ] || 'C' ) [ 0 ] : undefined )
16
16
17
17
export const inputs = {
18
18
selfHosted : undefined
@@ -334,7 +334,7 @@ function engineToToolCacheName(engine) {
334
334
} [ engine ]
335
335
}
336
336
337
- export function getToolCacheRubyPrefix ( platform , engine , version ) {
337
+ export function getToolCacheRubyPrefix ( _platform , engine , version ) {
338
338
const toolCache = getToolCachePath ( )
339
339
return path . join ( toolCache , engineToToolCacheName ( engine ) , version , os . arch ( ) )
340
340
}
@@ -356,15 +356,7 @@ export function win2nix(path) {
356
356
return path . replace ( / \\ / g, '/' ) . replace ( / / g, '\\ ' )
357
357
}
358
358
359
- // JRuby is installed after setupPath is called, so folder doesn't exist
360
- function rubyIsUCRT ( path ) {
361
- return ! ! ( fs . existsSync ( path ) &&
362
- fs . readdirSync ( path , { withFileTypes : true } ) . find ( dirent =>
363
- dirent . isFile ( ) && dirent . name . match ( / ^ x 6 4 - ( u c r t | v c r u n t i m e \d { 3 } ) - r u b y \d { 3 } \. d l l $ / ) ) )
364
- }
365
-
366
359
export function setupPath ( newPathEntries ) {
367
- let msys2Type = null
368
360
const envPath = windows ? 'Path' : 'PATH'
369
361
const originalPath = process . env [ envPath ] . split ( path . delimiter )
370
362
let cleanPath = originalPath . filter ( entry => ! / \b r u b y \b / i. test ( entry ) )
@@ -382,29 +374,13 @@ export function setupPath(newPathEntries) {
382
374
core . exportVariable ( envPath , cleanPath . join ( path . delimiter ) )
383
375
}
384
376
385
- // Then add new path entries using core.addPath()
386
- let newPath
387
- const windowsToolchain = core . getInput ( 'windows-toolchain' )
388
- if ( windows && windowsToolchain !== 'none' ) {
389
- // main Ruby dll determines whether mingw or ucrt build
390
- msys2Type = os . arch ( ) === 'arm64'
391
- ? 'clangarm64'
392
- : rubyIsUCRT ( newPathEntries [ 0 ] ) ? 'ucrt64' : 'mingw64'
393
-
394
- // add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
395
- const msys2 = [ `C:\\msys64\\${ msys2Type } \\bin` , 'C:\\msys64\\usr\\bin' ]
396
- newPath = [ ...newPathEntries , ...msys2 ]
397
- } else {
398
- newPath = newPathEntries
399
- }
400
377
console . log ( `Entries added to ${ envPath } to use selected Ruby:` )
401
- for ( const entry of newPath ) {
378
+ for ( const entry of newPathEntries ) {
402
379
console . log ( ` ${ entry } ` )
403
380
}
404
381
core . endGroup ( )
405
382
406
- core . addPath ( newPath . join ( path . delimiter ) )
407
- return msys2Type
383
+ core . addPath ( newPathEntries . join ( path . delimiter ) )
408
384
}
409
385
410
386
export async function setupJavaHome ( rubyPrefix ) {
0 commit comments