Skip to content

Commit

Permalink
check parentDir exist
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Jun 17, 2021
1 parent 74e85df commit d680ebe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion 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')
Expand Down Expand Up @@ -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)) {
await io.mkdirP(parentDir)
}

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

0 comments on commit d680ebe

Please sign in to comment.