Skip to content

Commit 477b21f

Browse files
MSP-Gregeregon
authored andcommitted
Fix ruby-builder.js - Windows io.mkdirP("D:\\")
1 parent 65c1995 commit 477b21f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dist/index.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const os = require('os')
2+
const fs = require('fs')
23
const path = require('path')
34
const exec = require('@actions/exec')
45
const io = require('@actions/io')
@@ -44,7 +45,9 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
4445
const parentDir = path.dirname(rubyPrefix)
4546

4647
await io.rmRF(rubyPrefix)
47-
await io.mkdirP(parentDir)
48+
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
49+
await io.mkdirP(parentDir)
50+
}
4851

4952
const downloadPath = await common.measure('Downloading Ruby', async () => {
5053
const url = getDownloadURL(platform, engine, version)

0 commit comments

Comments
 (0)