Skip to content

Commit 18845bc

Browse files
authored
Checking for 'func' command works on MacOS too (#14)
Co-authored-by: Emad Alashi <emad@emadalashi.com>
1 parent b50a443 commit 18845bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

LogicAppUnit/Hosting/WorkflowTestHost.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,21 @@ private static void KillFunctionHostProcesses()
215215
private static string GetEnvPathForFunctionTools()
216216
{
217217
string exePath;
218-
if(OperatingSystem.IsWindows())
218+
if (OperatingSystem.IsWindows())
219219
{
220220
var enviromentPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine);
221-
exePath = enviromentPath.Split(';').Select(x => Path.Combine(x, "func.exe")).Where(x => File.Exists(x)).FirstOrDefault();
221+
exePath = enviromentPath.Split(Path.PathSeparator).Select(x => Path.Combine(x, "func.exe")).Where(x => File.Exists(x)).FirstOrDefault();
222222
}
223223
else
224224
{
225225
var enviromentPath = Environment.GetEnvironmentVariable("PATH");
226-
exePath = enviromentPath.Split(':').Select(x => Path.Combine(x, "func")).Where(x => File.Exists(x)).FirstOrDefault();
226+
exePath = enviromentPath.Split(Path.PathSeparator).Select(x => Path.Combine(x, "func")).Where(x => File.Exists(x)).FirstOrDefault();
227227
}
228228

229-
if (!string.IsNullOrWhiteSpace(exePath))
229+
if (!string.IsNullOrWhiteSpace(exePathWithExtension))
230230
{
231-
Console.WriteLine($"Path for Azure Function Core tools: {exePath}");
232-
return exePath;
231+
Console.WriteLine($"Path for Azure Function Core tools: {exePathWithExtension}");
232+
return exePathWithExtension;
233233
}
234234
else
235235
{

0 commit comments

Comments
 (0)