Skip to content

Commit 85539e4

Browse files
committed
shell - returning back on initial shell location after 'app run' execution.
Particularly when we move to cached apps or srv directories during module descriptor resolution.
1 parent dca208d commit 85539e4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

restx-core-shell/src/main/java/restx/core/shell/AppShellCommand.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ public RunAppCommandRunner(List<String> args) {
607607

608608
@Override
609609
public void run(final RestxShell shell) throws Exception {
610+
Path shellInitialLocation = shell.currentLocation();
610611
if(appNameArg.isPresent()) {
611612
shell.cd(standardCachedAppPath(appNameArg.get()));
612613
}
@@ -691,6 +692,9 @@ public void run(final RestxShell shell) throws Exception {
691692
.getComponent(AppSettings.class);
692693
new ShellAppRunner(appSettings, appClassName, compileMode, quiet, daemon, vmOptions)
693694
.run(shell);
695+
696+
// Moving back to initial location in case we either moved in cached apps or srv directory
697+
shell.cd(shellInitialLocation);
694698
}
695699

696700
private Optional<String> guessAppClassnameFromRestxModule(RestxShell shell) throws IOException {

0 commit comments

Comments
 (0)