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:
MSP-Greg
2020-06-10 23:41:09 +02:00
committed by Benoit Daloze
parent 037dfa7b6b
commit 44338c51c7
3 changed files with 39 additions and 6 deletions
+10 -3
View File
@@ -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}`)
}