Skip to content

Commit

Permalink
[580] Add the --rm option to the SPI apply update and revert commands
Browse files Browse the repository at this point in the history
  • Loading branch information
yersan committed Mar 5, 2024
1 parent 994cc09 commit 367ed5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public void generateApplyCommand() throws Exception {
expected.append(CliConstants.CANDIDATE_DIR).append(" \"").append(Path.of("foo").toAbsolutePath()).append("\"");
expected.append(" ");
expected.append(CliConstants.YES);
expected.append(" ");
expected.append(CliConstants.REMOVE);

final ProvisioningDefinition provisioningDefinition = defaultWfCoreDefinition()
.setChannelCoordinates(channelsFile.toString())
Expand Down Expand Up @@ -115,6 +117,8 @@ public void generateApplyCommandWithOsShell() throws Exception {
expected.append(CliConstants.CANDIDATE_DIR).append(" \"").append(Path.of("foo").toAbsolutePath()).append("\"");
expected.append(" ");
expected.append(CliConstants.YES);
expected.append(" ");
expected.append(CliConstants.REMOVE);

final ProvisioningDefinition provisioningDefinition = defaultWfCoreDefinition()
.setChannelCoordinates(channelsFile.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ public String getApplyUpdateCommand(Path installationPath, Path candidatePath) {
return CliConstants.Commands.UPDATE + " " + CliConstants.Commands.APPLY + " "
+ CliConstants.DIR + " " + escape(installationPath.toAbsolutePath()) + " "
+ CliConstants.CANDIDATE_DIR + " " + escape(candidatePath.toAbsolutePath()) + " "
+ CliConstants.YES;
+ CliConstants.YES + " "
+ CliConstants.REMOVE;
}

@Override
public String getApplyRevertCommand(Path installationPath, Path candidatePath) {
return CliConstants.Commands.REVERT + " " + CliConstants.Commands.APPLY + " "
+ CliConstants.DIR + " " + escape(installationPath.toAbsolutePath()) + " "
+ CliConstants.CANDIDATE_DIR + " " + escape(candidatePath.toAbsolutePath()) + " "
+ CliConstants.YES;
+ CliConstants.YES + " "
+ CliConstants.REMOVE;
}

private String escape(Path absolutePath) {
Expand Down

0 comments on commit 367ed5b

Please sign in to comment.