diff options
author | 2017-03-23 15:09:34 +0000 | |
---|---|---|
committer | 2017-03-23 17:53:39 +0000 | |
commit | fa27b5045df54394a07e22e247767e9ecca57b38 (patch) | |
tree | 69387e319dc5b55cb30dde3ea9303d0615028007 /src/main/cpp/blaze_util_platform.h | |
parent | f3991e880468047269e3c6cf213ad693cef679b6 (diff) |
Bazel client, Windows: implement GetHomeDir
Create a method in blaze_util_<platform> to
retrieve the path to the home dir ($HOME on
Linux/macOS, %USERPROFILE% on Windows), where we
look for the user's bazelrc file (".bazelrc").
--
Change-Id: I86be1dbe1f992ad55eb09b496024754099d54912
Reviewed-on: https://cr.bazel.build/9513
PiperOrigin-RevId: 151004759
MOS_MIGRATED_REVID=151004759
Diffstat (limited to 'src/main/cpp/blaze_util_platform.h')
-rw-r--r-- | src/main/cpp/blaze_util_platform.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/cpp/blaze_util_platform.h b/src/main/cpp/blaze_util_platform.h index 2f313a4eeb..f158b58a30 100644 --- a/src/main/cpp/blaze_util_platform.h +++ b/src/main/cpp/blaze_util_platform.h @@ -56,6 +56,10 @@ std::string GetSelfPath(); // Returns the directory Bazel can use to store output. std::string GetOutputRoot(); +// Returns the current user's home directory, or the empty string if unknown. +// On Linux/macOS, this is $HOME. On Windows this is %USERPROFILE%. +std::string GetHomeDir(); + // Returns the location of the global bazelrc file if it exists, otherwise "". std::string FindSystemWideBlazerc(); |