Consider news read if news.version > current version (#3734)

Avoids two installations of taskwarrior with differing versions from
constantly nagging and rewriting `news.version`
This commit is contained in:
Tejada-Omar 2024-12-23 09:34:51 -07:00 committed by GitHub
parent 1b9353dccc
commit 3bf0200602
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -593,7 +593,7 @@ int CmdNews::execute(std::string& output) {
std::cout << outro.str();
// Set a mark in the config to remember which version's release notes were displayed
if (news_version != current_version) {
if (news_version < current_version) {
CmdConfig::setConfigVariable("news.version", std::string(current_version), false);
// Revert back to default signal handling after displaying the outro
@ -641,7 +641,7 @@ bool CmdNews::should_nag() {
Version current_version = Version::Current();
if (news_version == current_version) {
if (news_version >= current_version) {
return false;
}