From 477b21f02be01bcb8030d50f37cfec92bfa615b6 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Fri, 18 Jun 2021 09:03:57 -0500 Subject: [PATCH] Fix ruby-builder.js - Windows io.mkdirP("D:\\") --- dist/index.js | 5 ++++- ruby-builder.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b7eda1b..d19d4ec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -58790,6 +58790,7 @@ __nccwpck_require__.r(__webpack_exports__); /* harmony export */ "install": () => (/* binding */ install) /* harmony export */ }); const os = __nccwpck_require__(2087) +const fs = __nccwpck_require__(5747) const path = __nccwpck_require__(5622) const exec = __nccwpck_require__(1514) const io = __nccwpck_require__(7436) @@ -58835,7 +58836,9 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) { const parentDir = path.dirname(rubyPrefix) await io.rmRF(rubyPrefix) - await io.mkdirP(parentDir) + if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) { + await io.mkdirP(parentDir) + } const downloadPath = await common.measure('Downloading Ruby', async () => { const url = getDownloadURL(platform, engine, version) diff --git a/ruby-builder.js b/ruby-builder.js index 912a6b6..9d6b41b 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -1,4 +1,5 @@ const os = require('os') +const fs = require('fs') const path = require('path') const exec = require('@actions/exec') const io = require('@actions/io') @@ -44,7 +45,9 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) { const parentDir = path.dirname(rubyPrefix) await io.rmRF(rubyPrefix) - await io.mkdirP(parentDir) + if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) { + await io.mkdirP(parentDir) + } const downloadPath = await common.measure('Downloading Ruby', async () => { const url = getDownloadURL(platform, engine, version)