Skip to content

Commit

Permalink
chore: work dir namespacing for Windows (#191)
Browse files Browse the repository at this point in the history
* chore: namespace work dir in windows

* chore: namespace work dir in windows
  • Loading branch information
jcosentino11 authored Aug 14, 2023
1 parent a939e05 commit 62a57f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions port_driver/write_config/write_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ int copy_default_config() {

LOG_I(WRITE_CONFIG_SUBJECT, "Copying default EMQX configuration");

std::filesystem::create_directories(new_etc_path);
std::filesystem::create_directories(new_data_path);

// Copy from the original path to the new paths which we be loaded by EMQX
std::filesystem::copy(original_etc_dir, new_etc_path, recursive_copy_options);
std::filesystem::copy(original_data_dir, new_data_path, recursive_copy_options);
Expand Down Expand Up @@ -134,9 +137,6 @@ int read_config_and_update_files(GreengrassIPCWrapper &ipc) {
const std::filesystem::path etc_dir(std::getenv(EMQX_ETC_DIR_ENV_VAR));
auto emqx_conf = etc_dir / EMQX_CONF_FILE;

// Try to create the directories as needed, ignoring errors
std::filesystem::create_directories(emqx_conf.parent_path());

// Configuration is in the form of
// {"emqxConfig": {"listeners": {"ssl": {"default": ...}}}}
// We do not check if the config is valid, this is handled by EMQx.
Expand Down
8 changes: 4 additions & 4 deletions recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"EMQX_PLUGINS__INSTALL_DIR": "{artifacts:decompressedPath}\\emqx\\emqx\\plugins",
"ORIG_EMQX_NODE__DATA_DIR": "{artifacts:decompressedPath}\\emqx\\emqx\\data",
"ORIG_EMQX_NODE__ETC_DIR": "{artifacts:decompressedPath}\\emqx\\emqx\\etc",
"EMQX_NODE__DATA_DIR": "{work:path}\\data",
"EMQX_NODE__ETC_DIR": "{work:path}\\etc",
"EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__KEYFILE": "{work:path}\\data\\key.pem",
"EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CERTFILE": "{work:path}\\data\\cert.pem",
"EMQX_NODE__DATA_DIR": "{work:path}\\v2\\data",
"EMQX_NODE__ETC_DIR": "{work:path}\\v2\\etc",
"EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__KEYFILE": "{work:path}\\v2\\data\\key.pem",
"EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CERTFILE": "{work:path}\\v2\\data\\cert.pem",
"IPC_TIMEOUT_SECONDS": "{configuration:/ipcTimeoutSeconds}",
"RESTART_IDENTIFIER": "{configuration:/restartIdentifier}",
"CRT_LOG_LEVEL": "{configuration:/crtLogLevel}",
Expand Down

0 comments on commit 62a57f4

Please sign in to comment.