From 647c3c4a2d750f6e03d0c3af6f768fde9c64cb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:34:45 +0100 Subject: [PATCH] Allow overriding of default application path directory (#4418) --- nano/secure/utility.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nano/secure/utility.cpp b/nano/secure/utility.cpp index 0ed99eb9b1..d7e263d81f 100644 --- a/nano/secure/utility.cpp +++ b/nano/secure/utility.cpp @@ -9,6 +9,13 @@ static std::vector all_unique_paths; std::filesystem::path nano::working_path (nano::networks network) { auto result (nano::app_path ()); + + if (auto path_override = nano::get_env ("NANO_APP_PATH")) + { + result = *path_override; + std::cerr << "Application path overridden by NANO_APP_PATH environment variable: " << result << std::endl; + } + switch (network) { case nano::networks::invalid: