mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Fix tar extraction with windows-2016 image
1. common.js - add function win2nix(path) to convert windows style paths to nix style 2. ruby_builder.js - use Git tar for windows-2016, leave windows-2019 as is
This commit is contained in:
+10
-3
@@ -34,9 +34,16 @@ async function downloadAndExtract(platform, engine, version) {
|
||||
return await tc.downloadTool(url)
|
||||
})
|
||||
|
||||
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
|
||||
await common.measure('Extracting Ruby', async () =>
|
||||
exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ]))
|
||||
await common.measure('Extracting Ruby', async () => {
|
||||
if (process.env.ImageOS === 'win16') {
|
||||
const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"'
|
||||
await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f',
|
||||
common.win2nix(downloadPath) ])
|
||||
} else {
|
||||
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
|
||||
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])
|
||||
}
|
||||
})
|
||||
|
||||
return path.join(rubiesDir, `${engine}-${version}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user