mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Make g3 LocalAppDataPath match .NET path.
PiperOrigin-RevId: 700180665
This commit is contained in:
committed by
Copybara-Service
parent
b46cbc62b4
commit
99201215c0
@@ -15,7 +15,8 @@
|
||||
#ifndef PLATFORM_IMPL_G3_DEVICE_INFO_H_
|
||||
#define PLATFORM_IMPL_G3_DEVICE_INFO_H_
|
||||
|
||||
#include <filesystem>
|
||||
#include <cstdlib>
|
||||
#include <filesystem> // NOLINT
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@@ -47,7 +48,12 @@ class DeviceInfo : public api::DeviceInfo {
|
||||
}
|
||||
|
||||
std::optional<std::filesystem::path> GetLocalAppDataPath() const override {
|
||||
return std::filesystem::temp_directory_path();
|
||||
const char* home_dir = getenv("HOME");
|
||||
if (home_dir == nullptr) {
|
||||
return std::filesystem::temp_directory_path();
|
||||
}
|
||||
// Yhis matches the .NET LocalAppData directory on Linux.
|
||||
return std::filesystem::path(home_dir).append(".local").append("share");
|
||||
}
|
||||
|
||||
std::optional<std::filesystem::path> GetCommonAppDataPath() const override {
|
||||
|
||||
Reference in New Issue
Block a user