This commit is contained in:
Benoit Daloze
2020-06-10 23:44:28 +02:00
parent 44338c51c7
commit bf8b766096
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ function findUbuntuVersion() {
export function win2nix(path) { export function win2nix(path) {
if (/^[A-Z]:/i.test(path)) { if (/^[A-Z]:/i.test(path)) {
// path starts with drive // path starts with drive
path = `/${path[0].toLowerCase()}${path.split(':')[1]}` path = `/${path[0].toLowerCase()}${path.split(':', 2)[1]}`
} }
return path.replace(/\\/g, '/').replace(/ /g, '\\ ') return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
} }
Generated Vendored
+2 -3
View File
@@ -1571,7 +1571,7 @@ function findUbuntuVersion() {
function win2nix(path) { function win2nix(path) {
if (/^[A-Z]:/i.test(path)) { if (/^[A-Z]:/i.test(path)) {
// path starts with drive // path starts with drive
path = `/${path[0].toLowerCase()}${path.split(':')[1]}` path = `/${path[0].toLowerCase()}${path.split(':', 2)[1]}`
} }
return path.replace(/\\/g, '/').replace(/ /g, '\\ ') return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
} }
@@ -3595,8 +3595,7 @@ async function downloadAndExtract(platform, engine, version) {
await common.measure('Extracting Ruby', async () => { await common.measure('Extracting Ruby', async () => {
if (process.env.ImageOS === 'win16') { if (process.env.ImageOS === 'win16') {
const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"' const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"'
await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', common.win2nix(downloadPath) ])
common.win2nix(downloadPath) ])
} else { } else {
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ]) await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])
+1 -2
View File
@@ -37,8 +37,7 @@ async function downloadAndExtract(platform, engine, version) {
await common.measure('Extracting Ruby', async () => { await common.measure('Extracting Ruby', async () => {
if (process.env.ImageOS === 'win16') { if (process.env.ImageOS === 'win16') {
const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"' const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"'
await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', common.win2nix(downloadPath) ])
common.win2nix(downloadPath) ])
} else { } else {
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ]) await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])