Skip to content

Commit

Permalink
fix(runner): allow moving to the root node
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Oct 30, 2024
1 parent 38c9557 commit 3749a7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/swisscom/aem/tools/impl/hops/MoveNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void run(Config config, Node node, HopContext context) throws RepositoryE
return;
}

final String absolutePath = descriptor.getParent().getPath() + '/' + descriptor.getNewChildName();
final Node effectiveParent = descriptor.getParent();
final String absolutePath = StringUtils.stripEnd(effectiveParent.getPath(), "/") + '/' + descriptor.getNewChildName();
context.info("Moving node from {} to {}", node.getPath(), absolutePath);

node.getSession().move(node.getPath(), absolutePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
class CreateChildNodeTest {

public final AemContext context = new JcrOakAemContext();

private RunnerBuilder builder;
private Session session;

Expand Down

0 comments on commit 3749a7b

Please sign in to comment.