diff --git a/common.js b/common.js index ec83465..9d688ed 100644 --- a/common.js +++ b/common.js @@ -47,7 +47,7 @@ function findUbuntuVersion() { export function win2nix(path) { if (/^[A-Z]:/i.test(path)) { // 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, '\\ ') } diff --git a/dist/index.js b/dist/index.js index ab23906..9e7ea06 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1571,7 +1571,7 @@ function findUbuntuVersion() { function win2nix(path) { if (/^[A-Z]:/i.test(path)) { // 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, '\\ ') } @@ -3595,8 +3595,7 @@ async function downloadAndExtract(platform, engine, version) { 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) ]) + 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 ]) diff --git a/ruby-builder.js b/ruby-builder.js index ffda0e5..aafec8f 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -37,8 +37,7 @@ async function downloadAndExtract(platform, engine, version) { 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) ]) + 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 ])