Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions projects/Unit/Fixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -417,7 +418,6 @@ internal Process ExecRabbitMQCtl(string args)
{
// Allow the path to the rabbitmqctl.bat to be set per machine
string envVariable = Environment.GetEnvironmentVariable("RABBITMQ_RABBITMQCTL_PATH");

string rabbitmqctlPath;

if (envVariable != null)
Expand All @@ -428,19 +428,31 @@ internal Process ExecRabbitMQCtl(string args)
if (match.Success)
{
return ExecRabbitMqCtlUsingDocker(args, match.Groups["dockerMachine"].Value);
}
else
{
} else {
rabbitmqctlPath = envVariable;
}
}
else if (IsRunningOnMonoOrDotNetCore())
{
rabbitmqctlPath = "../../../../../../rabbit/scripts/rabbitmqctl";
}
else
{
rabbitmqctlPath = @"..\..\..\..\..\..\rabbit\scripts\rabbitmqctl.bat";
// provided by the umbrella
string umbrellaRabbitmqctlPath;
// provided in PATH by a RabbitMQ installation
string providedRabbitmqctlPath;

if (IsRunningOnMonoOrDotNetCore())
{
umbrellaRabbitmqctlPath = "../../../../../../rabbit/scripts/rabbitmqctl";
providedRabbitmqctlPath = "rabbitmqctl";
} else {
umbrellaRabbitmqctlPath = @"..\..\..\..\..\..\rabbit\scripts\rabbitmqctl.bat";
providedRabbitmqctlPath = "rabbitmqctl.bat";
}

if (File.Exists(umbrellaRabbitmqctlPath)) {
rabbitmqctlPath = umbrellaRabbitmqctlPath;
} else {
rabbitmqctlPath = providedRabbitmqctlPath;
}
}

return ExecCommand(rabbitmqctlPath, args);
Expand Down