Skip to content

Commit 31a7f6d

Browse files
committed
No longer remove the prefix before extraction, extracting should be idempotent
* Fixes #191
1 parent 59b5745 commit 31a7f6d

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

dist/index.js

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function install(platform, engine, version) {
5050
common.setupPath([path.join(rubyPrefix, 'bin')])
5151

5252
if (!inToolCache) {
53-
await preparePrefix(rubyPrefix)
53+
await io.mkdirP(rubyPrefix)
5454
if (engine === 'truffleruby+graalvm') {
5555
await installWithRubyBuild(engine, version, rubyPrefix)
5656
} else {
@@ -61,15 +61,6 @@ export async function install(platform, engine, version) {
6161
return rubyPrefix
6262
}
6363

64-
async function preparePrefix(rubyPrefix) {
65-
const parentDir = path.dirname(rubyPrefix)
66-
67-
await io.rmRF(rubyPrefix)
68-
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
69-
await io.mkdirP(parentDir)
70-
}
71-
}
72-
7364
async function installWithRubyBuild(engine, version, rubyPrefix) {
7465
const tmp = process.env['RUNNER_TEMP'] || os.tmpdir()
7566
const rubyBuildDir = path.join(tmp, 'ruby-build-for-setup-ruby')

0 commit comments

Comments
 (0)