Skip to content

Commit 05912e1

Browse files
committed
(GH-1602) exit 2 on items outdated
When items are outdated, the exit should indicate that it is not all good to go as there is possible work to do. A zero exit code should only be used if choco outdated does not return any results. - Exit of 0 indicates all up to date - Exit of 2 indicates out of date packages - Exit of 1 or -1 would indicate an error
1 parent c18afec commit 05912e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs

+5
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ Output is package name | current version | available version | pinned?
656656
}
657657
}
658658

659+
if (oudatedPackages.Count != 0 && Environment.ExitCode == 0)
660+
{
661+
Environment.ExitCode = 2;
662+
}
663+
659664
randomly_notify_about_pro_business(config);
660665
}
661666

0 commit comments

Comments
 (0)