mirror of https://gitee.com/bigwinds/arangodb
copy enterprise files too when starting with `--javascript.copy-installation` (#7818)
This commit is contained in:
parent
7b571d311d
commit
cc66e7f91f
|
@ -409,7 +409,7 @@ void V8DealerFeature::copyInstallationFiles() {
|
|||
|
||||
// get base path from DatabasePathFeature
|
||||
auto dbPathFeature = application_features::ApplicationServer::getFeature<DatabasePathFeature>();
|
||||
const std::string copyJSPath = FileUtils::buildFilename(dbPathFeature->directory(), "js");
|
||||
std::string const copyJSPath = FileUtils::buildFilename(dbPathFeature->directory(), "js");
|
||||
if (copyJSPath == _startupDirectory) {
|
||||
LOG_TOPIC(FATAL, arangodb::Logger::V8)
|
||||
<< "'javascript.startup-directory' cannot be inside 'database.directory'";
|
||||
|
@ -489,6 +489,17 @@ void V8DealerFeature::copyInstallationFiles() {
|
|||
<< "': " << error;
|
||||
FATAL_ERROR_EXIT();
|
||||
}
|
||||
|
||||
// attempt to copy enterprise JS files too.
|
||||
// only required for developer installations, not packages
|
||||
std::string const enterpriseJs = basics::FileUtils::buildFilename(_startupDirectory, "..", "enterprise", "js");
|
||||
|
||||
if (FileUtils::isDirectory(enterpriseJs)) {
|
||||
std::function<bool(std::string const&)> const passAllFilter = [](std::string const&) { return false; };
|
||||
if (!FileUtils::copyRecursive(enterpriseJs, copyJSPath, passAllFilter, error)) {
|
||||
LOG_TOPIC(WARN, Logger::V8) << "Error copying enterprise JS installation files to '" << copyJSPath << "': " << error;
|
||||
}
|
||||
}
|
||||
}
|
||||
_startupDirectory = copyJSPath;
|
||||
}
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
namespace arangodb {
|
||||
class FileResultString : public FileResult {
|
||||
public:
|
||||
FileResultString(std::string result) : FileResult(), _result(result) {}
|
||||
FileResultString(std::string const& result) : FileResult(), _result(result) {}
|
||||
|
||||
FileResultString(int sysErrorNumber, std::string result)
|
||||
FileResultString(int sysErrorNumber, std::string const& result)
|
||||
: FileResult(sysErrorNumber), _result(result) {}
|
||||
|
||||
FileResultString(int sysErrorNumber)
|
||||
|
|
|
@ -379,7 +379,7 @@ bool copyDirectoryRecursive(std::string const& source,
|
|||
if (isSubDirectory(src)) {
|
||||
long systemError;
|
||||
int rc = TRI_CreateDirectory(dst.c_str(), systemError, error);
|
||||
if (rc != TRI_ERROR_NO_ERROR) {
|
||||
if (rc != TRI_ERROR_NO_ERROR && rc != TRI_ERROR_FILE_EXISTS) {
|
||||
break;
|
||||
}
|
||||
if (!copyDirectoryRecursive(src, dst, filter, error)) {
|
||||
|
|
Loading…
Reference in New Issue