Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
shell - chrooting on srv/ sub-directory when 'app run' command is lau…
…nched from a directory not containing a md.restx.json file.
This fixes #188
- Loading branch information
|
@@ -611,6 +611,28 @@ public void run(final RestxShell shell) throws Exception { |
|
|
shell.cd(standardCachedAppPath(appNameArg.get())); |
|
|
} |
|
|
|
|
|
if(!ModuleDescriptorType.RESTX.resolveDescriptorFile(shell.currentLocation()).exists()) { |
|
|
|
|
|
Path srvDir = shell.currentLocation().resolve("srv"); |
|
|
if(srvDir.toFile().exists()) { |
|
|
shell.cd(srvDir); |
|
|
if(!ModuleDescriptorType.RESTX.resolveDescriptorFile(shell.currentLocation()).exists()) { |
|
|
shell.println(String.format("Cannot find %s in both %s and %s", |
|
|
ModuleDescriptorType.RESTX.getDescriptorFileName(), |
|
|
shell.currentLocation().getParent().toAbsolutePath(), |
|
|
shell.currentLocation().toAbsolutePath())); |
|
|
shell.println("=> Cannot run application"); |
|
|
return; |
|
|
} |
|
|
} else { |
|
|
shell.println(String.format("Cannot find %s in %s", |
|
|
ModuleDescriptorType.RESTX.getDescriptorFileName(), |
|
|
shell.currentLocation().toAbsolutePath())); |
|
|
shell.println("=> Cannot run application"); |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
boolean sourcesAvailable = Apps.with(shell.getFactory().getComponent(AppSettings.class)).sourcesAvailableIn(shell.currentLocation()); |
|
|
|
|
|
String appClassName; |
|
|