Skip to content

Commit 9245d43

Browse files
committed
add timeout and update targetframeworks logic
1 parent cb68604 commit 9245d43

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Amazon.Common.DotNetCli.Tools/Utilities.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public static Dictionary<string, string> LookupProjectProperties(string projectL
242242
process.Start();
243243
string output = process.StandardOutput.ReadToEnd();
244244
string error = process.StandardError.ReadToEnd();
245-
process.WaitForExit();
245+
process.WaitForExit(5000);
246246

247247
if (process.ExitCode == 0)
248248
{
@@ -311,7 +311,11 @@ public static string LookupTargetFrameworkFromProjectFile(string projectLocation
311311
}
312312
if (properties.TryGetValue("TargetFrameworks", out var targetFrameworks) && !string.IsNullOrEmpty(targetFrameworks))
313313
{
314-
return targetFrameworks.Split(';')[0];
314+
var frameworks = targetFrameworks.Split(';');
315+
if (frameworks.Length > 1 ){
316+
return null;
317+
}
318+
return frameworks[0];
315319
}
316320
return null;
317321
}

0 commit comments

Comments
 (0)