Skip to content

Commit

Permalink
fix: link launch dir with existing nucleus package if does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-mage committed Dec 3, 2024
1 parent 2554a42 commit 459b26a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,19 @@ public boolean isLaunchDirSetup() {
*/
public void validateLaunchDirSetupVerbose() throws DirectoryValidationException, DeploymentException {
Path currentDir = getCurrentDir();
if (!Files.isSymbolicLink(currentDir)) {
throw new DirectoryValidationException("Missing symlink to current nucleus launch directory");
if (!Files.isSymbolicLink(getCurrentDir())) {
try {
/*
Simply recreating a new init dir and relinking the current Nucleus jar path to it should be
sufficient as the kernel update workflow will create the new launch dir and its links anyway
*/
relinkInitLaunchDir(locateCurrentKernelUnpackDir(), true);
} catch (IOException ex) {
throw new DirectoryValidationException("Unable to relink init launch directory", ex);
} catch (URISyntaxException ex) {
// TODO: Fix usage of root path with spaces on linux
throw new DeploymentException("Unable to relink init launch directory", ex);
}
}
Path loaderPath = getLoaderPathFromLaunchDir(currentDir);
if (Files.exists(loaderPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ public DirectoryValidationException(String message) {
super(message);
super.addErrorCode(DeploymentErrorCode.LAUNCH_DIRECTORY_CORRUPTED);
}

public DirectoryValidationException(String message, Throwable throwable) {
super(message, throwable);
super.addErrorCode(DeploymentErrorCode.LAUNCH_DIRECTORY_CORRUPTED);
}
}

0 comments on commit 459b26a

Please sign in to comment.