Skip to content

Commit 91fa51c

Browse files
authored
Merge pull request #17 from IBM/refactor/config-order
refactor: look at project directory before home directory
2 parents 684b901 + d53613a commit 91fa51c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Utilities/CredentialUtils.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,36 +133,36 @@ private static List<string> GetFilesToCheck()
133133
files.Add(userSpecifedPath);
134134
}
135135

136-
if (!string.IsNullOrEmpty(unixHomeDirectory))
136+
if (!string.IsNullOrEmpty(projectDirectory))
137137
{
138-
var fullPath = Path.GetFullPath(Path.Combine(unixHomeDirectory, defaultCredentialFileName));
138+
var fullPath = Path.GetFullPath(Path.Combine(projectDirectory, defaultCredentialFileName));
139139
if (File.Exists(fullPath))
140140
{
141141
files.Add(fullPath);
142142
}
143143
}
144144

145-
if (!string.IsNullOrEmpty(windowsFirstHomeDirectory))
145+
if (!string.IsNullOrEmpty(unixHomeDirectory))
146146
{
147-
var fullPath = Path.GetFullPath(Path.Combine(windowsFirstHomeDirectory, defaultCredentialFileName));
147+
var fullPath = Path.GetFullPath(Path.Combine(unixHomeDirectory, defaultCredentialFileName));
148148
if (File.Exists(fullPath))
149149
{
150150
files.Add(fullPath);
151151
}
152152
}
153153

154-
if (!string.IsNullOrEmpty(windowsSecondHomeDirectory))
154+
if (!string.IsNullOrEmpty(windowsFirstHomeDirectory))
155155
{
156-
var fullPath = Path.GetFullPath(Path.Combine(windowsSecondHomeDirectory, defaultCredentialFileName));
156+
var fullPath = Path.GetFullPath(Path.Combine(windowsFirstHomeDirectory, defaultCredentialFileName));
157157
if (File.Exists(fullPath))
158158
{
159159
files.Add(fullPath);
160160
}
161161
}
162162

163-
if (!string.IsNullOrEmpty(projectDirectory))
163+
if (!string.IsNullOrEmpty(windowsSecondHomeDirectory))
164164
{
165-
var fullPath = Path.GetFullPath(Path.Combine(projectDirectory, defaultCredentialFileName));
165+
var fullPath = Path.GetFullPath(Path.Combine(windowsSecondHomeDirectory, defaultCredentialFileName));
166166
if (File.Exists(fullPath))
167167
{
168168
files.Add(fullPath);

0 commit comments

Comments
 (0)