aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-01-14 15:34:57 -0800
committerLiam Mitchell <[email protected]>2026-01-14 15:36:09 -0800
commite44934cf1b4783420f5a4c6acbdbac44488d92a9 (patch)
tree54514f3878421108ce26a1f88eafda95aa90f6aa /src/zencore/filesystem.cpp
parentadded early-out check in GcManager::ScrubStorage(ScrubContext& GcCtx) (#698) (diff)
downloadzen-e44934cf1b4783420f5a4c6acbdbac44488d92a9.tar.xz
zen-e44934cf1b4783420f5a4c6acbdbac44488d92a9.zip
Use well-known OidcToken paths or command line arguments to determine OidcToken executable path
Diffstat (limited to 'src/zencore/filesystem.cpp')
-rw-r--r--src/zencore/filesystem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 7f341818b..8adb66972 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -2756,6 +2756,18 @@ GetEnvVariable(std::string_view VariableName)
return "";
}
+bool
+SetEnvVariable(std::string Name, std::string Value)
+{
+ ZEN_ASSERT(!Name.empty() && !Value.empty());
+#if ZEN_PLATFORM_WINDOWS
+ return SetEnvironmentVariableA(Name.c_str(), Value.c_str());
+#endif
+#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
+ return setenv(Name.c_str(), Value.c_str(), /* overwrite */ 1) == 0;
+#endif
+}
+
std::error_code
RotateFiles(const std::filesystem::path& Filename, std::size_t MaxFiles)
{