Skip to content

Commit 1b4e7be

Browse files
committed
chore: Look for credentials in userprofile
1 parent 3b98609 commit 1b4e7be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/IBM.WatsonDeveloperCloud/Util/Utility.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ public static List<string> GetCredentialsPaths()
155155
filePathsToLoad.Add(windowsHomePath);
156156
}
157157

158+
string userProfilePath = Environment.ExpandEnvironmentVariables("%USERPROFILE%") + "\\ibm-credentials.env";
159+
if (!string.IsNullOrEmpty(Environment.ExpandEnvironmentVariables("%USERPROFILE%")) && File.Exists(userProfilePath))
160+
{
161+
filePathsToLoad.Add(userProfilePath);
162+
}
163+
158164
if (File.Exists(@"ibm-credentials.env"))
159165
{
160166
filePathsToLoad.Add(@"ibm-credentials.env");

0 commit comments

Comments
 (0)