mirror of https://gitee.com/bigwinds/arangodb
port startup fix
This commit is contained in:
parent
f93b6fd7b8
commit
e51359b68e
|
@ -215,6 +215,28 @@ void V8DealerFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
|
|||
|
||||
ctx->normalizePath(_startupDirectory, "javascript.startup-directory", true);
|
||||
ctx->normalizePath(_moduleDirectory, "javascript.module-directory", false);
|
||||
|
||||
|
||||
// try to append the current version name to the startup directory,
|
||||
// so instead of "/path/to/js" we will get "/path/to/js/3.4.0"
|
||||
std::string const versionAppendix = std::regex_replace(rest::Version::getServerVersion(), std::regex("-.*$"), "");
|
||||
std::string versionedPath = basics::FileUtils::buildFilename(_startupDirectory, versionAppendix);
|
||||
|
||||
LOG_TOPIC(DEBUG, Logger::V8) << "checking for existence of version-specific startup-directory '" << versionedPath << "'";
|
||||
if (basics::FileUtils::isDirectory(versionedPath)) {
|
||||
// version-specific js path exists!
|
||||
_startupDirectory = versionedPath;
|
||||
}
|
||||
|
||||
for (auto& it : _moduleDirectory) {
|
||||
versionedPath = basics::FileUtils::buildFilename(it, versionAppendix);
|
||||
|
||||
LOG_TOPIC(DEBUG, Logger::V8) << "checking for existence of version-specific module-directory '" << versionedPath << "'";
|
||||
if (basics::FileUtils::isDirectory(versionedPath)) {
|
||||
// version-specific js path exists!
|
||||
it = versionedPath;
|
||||
}
|
||||
}
|
||||
|
||||
// check whether app-path was specified
|
||||
if (_appPath.empty()) {
|
||||
|
|
Loading…
Reference in New Issue