Properly set working directory when running post install hooks

This commit is contained in:
Caelan Sayler
2022-01-01 22:00:51 +00:00
parent c3fd1c52d6
commit 7824298edc
3 changed files with 3 additions and 2 deletions

View File

@@ -408,7 +408,7 @@ namespace Squirrel
cts.CancelAfter(15 * 1000);
try {
await Utility.InvokeProcessAsync(exe, args, cts.Token).ConfigureAwait(false);
await Utility.InvokeProcessAsync(exe, args, cts.Token, Path.GetDirectoryName(exe)).ConfigureAwait(false);
} catch (Exception ex) {
this.Log().ErrorException("Couldn't run Squirrel hook, continuing: " + exe, ex);
}

View File

@@ -90,7 +90,8 @@ namespace Squirrel.Tests
Assert.True(File.Exists(Path.Combine(tempDir, "theApp", "app-0.2.0", "args.txt")));
var text = File.ReadAllText(Path.Combine(tempDir, "theApp", "app-0.2.0", "args.txt"), Encoding.UTF8);
Assert.Contains("updated|0.2.0", text);
Assert.Contains("updated", text);
Assert.Contains("0.2.0", text);
}
}

Binary file not shown.