Skip to content

Commit

Permalink
No longer remove the prefix before extraction, extracting should be i…
Browse files Browse the repository at this point in the history
…dempotent

* Fixes #191
  • Loading branch information
eregon committed Mar 5, 2023
1 parent 59b5745 commit 31a7f6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions dist/index.js

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

11 changes: 1 addition & 10 deletions ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function install(platform, engine, version) {
common.setupPath([path.join(rubyPrefix, 'bin')])

if (!inToolCache) {
await preparePrefix(rubyPrefix)
await io.mkdirP(rubyPrefix)
if (engine === 'truffleruby+graalvm') {
await installWithRubyBuild(engine, version, rubyPrefix)
} else {
Expand All @@ -61,15 +61,6 @@ export async function install(platform, engine, version) {
return rubyPrefix
}

async function preparePrefix(rubyPrefix) {
const parentDir = path.dirname(rubyPrefix)

await io.rmRF(rubyPrefix)
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
await io.mkdirP(parentDir)
}
}

async function installWithRubyBuild(engine, version, rubyPrefix) {
const tmp = process.env['RUNNER_TEMP'] || os.tmpdir()
const rubyBuildDir = path.join(tmp, 'ruby-build-for-setup-ruby')
Expand Down

0 comments on commit 31a7f6d

Please sign in to comment.