Treat a nonzero exit status as a failure (#3430)

And fix the test cases that have been failing ,undetected
This commit is contained in:
Dustin J. Mitchell 2024-05-03 09:58:09 -04:00 committed by GitHub
parent 50cfbe8b63
commit 28a46880a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 62 additions and 75 deletions

View file

@ -439,6 +439,7 @@ Context* Context::context;
////////////////////////////////////////////////////////////////////////////////
Context& Context::getContext ()
{
assert (Context::context);
return *Context::context;
}

View file

@ -28,6 +28,7 @@
#include <CmdVersion.h>
#include <sstream>
#include <stdlib.h>
#include <Datetime.h>
#include <Context.h>
#include <Table.h>
#ifdef HAVE_COMMIT
@ -70,6 +71,8 @@ int CmdVersion::execute (std::string& output)
link.add ("");
link.set (link.addRow (), 0, "Documentation for Taskwarrior can be found using 'man task', 'man taskrc', 'man task-color', 'man task-sync' or at https://taskwarrior.org");
Datetime now;
Color bold;
if (Context::getContext ().color ())
bold = Color ("bold");
@ -78,7 +81,7 @@ int CmdVersion::execute (std::string& output)
<< format ("{1} {2} built for ", bold.colorize (PACKAGE), bold.colorize (VERSION))
<< osName ()
<< '\n'
<< "Copyright (C) 2006 - 2021 T. Babej, P. Beckingham, F. Hernandez."
<< "Copyright (C) 2006 - " << now.year () << " T. Babej, P. Beckingham, F. Hernandez."
<< '\n'
<< '\n'
<< disclaimer.render ()