Skip to content

Commit

Permalink
Install GraalVM components before move (#1660)
Browse files Browse the repository at this point in the history
Install the required GraalVM components before 
moving the directory.
  • Loading branch information
4e6 authored Apr 9, 2021
1 parent 9f60e22 commit 0aa5b56
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,16 @@ class RuntimeVersionManager(
}

try {
val temporaryRuntime = loadGraalRuntime(runtimeTemporaryPath)
if (temporaryRuntime.isFailure) {
val temporaryRuntime =
loadGraalRuntime(runtimeTemporaryPath).getOrElse {
throw InstallationError(
"Cannot load the installed runtime. The package may have been " +
"corrupted. Reverting installation."
)
}
installRequiredRuntimeComponents(temporaryRuntime, os).getOrElse {
throw InstallationError(
"Cannot load the installed runtime. The package may have been " +
"corrupted. Reverting installation."
"fatal: Cannot install the required runtime components."
)
}

Expand All @@ -714,13 +719,6 @@ class RuntimeVersionManager(
"fatal: Cannot load the installed runtime."
)
}
installRequiredRuntimeComponents(runtime, os).getOrElse {
FileSystem.removeDirectory(runtimePath)
throw InstallationError(
"fatal: Cannot install the required runtime components."
)
}

userInterface.logInfo(s"Installed $runtime.")

runtime
Expand Down

0 comments on commit 0aa5b56

Please sign in to comment.