Skip to content

Commit

Permalink
Log working directory being used to run commands
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 6, 2024
1 parent ca43ff3 commit b2e114f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ private static void findSolutionPath()
public static bool RunCommand(string command, string args, bool useSolutionPath = true, Dictionary<string, string>? environmentVariables = null, bool throwIfNonZero = true,
bool exitOnFail = true)
{
string workingDirectory = useSolutionPath ? SolutionPath : Environment.CurrentDirectory;

Logger.Write($"Using working directory {workingDirectory}...");
Logger.Write($"Running {command} {args}...");

var psi = new ProcessStartInfo(command, args)
{
WorkingDirectory = useSolutionPath ? SolutionPath : Environment.CurrentDirectory,
WorkingDirectory = workingDirectory,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
Expand Down

0 comments on commit b2e114f

Please sign in to comment.