Add test for automatic update

This commit is contained in:
Caelan Sayler
2023-12-26 20:45:38 +00:00
parent ce35a294db
commit a3a8e319bd
2 changed files with 45 additions and 3 deletions

View File

@@ -6,8 +6,10 @@ using Squirrel.Locators;
try {
bool shouldExit = false;
bool shouldAutoUpdate = args.Any(a => a.Equals("--autoupdate", StringComparison.OrdinalIgnoreCase));
SquirrelApp.Build()
.SetAutoApplyOnStartup(false)
.SetAutoApplyOnStartup(shouldAutoUpdate)
.WithFirstRun((v) => {
debugFile("firstrun", v.ToString());
Console.WriteLine("was first run");
@@ -24,6 +26,11 @@ try {
.WithBeforeUninstallFastCallback((v) => debugFile("args.txt", String.Join(" ", args)))
.Run(new ConsoleLogger());
if (shouldAutoUpdate) {
// this shouldn't be reached
return -1;
}
if (shouldExit) {
return 0;
}