mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Throw error when task config write is unsuccessfully (#3620)
This commit is contained in:
parent
6a24510473
commit
c00c0e941b
1 changed files with 6 additions and 2 deletions
|
@ -95,7 +95,9 @@ bool CmdConfig::setConfigVariable(const std::string& name, const std::string& va
|
|||
change = true;
|
||||
}
|
||||
|
||||
if (change) File::write(Context::getContext().config.file(), contents);
|
||||
if (change)
|
||||
if (!File::write(Context::getContext().config.file(), contents))
|
||||
throw format("Could not write to '{1}'.", Context::getContext().config.file());
|
||||
|
||||
return change;
|
||||
}
|
||||
|
@ -133,7 +135,9 @@ int CmdConfig::unsetConfigVariable(const std::string& name, bool confirmation /*
|
|||
if (!lineDeleted) line++;
|
||||
}
|
||||
|
||||
if (change) File::write(Context::getContext().config.file(), contents);
|
||||
if (change)
|
||||
if (!File::write(Context::getContext().config.file(), contents))
|
||||
throw format("Could not write to '{1}'.", Context::getContext().config.file());
|
||||
|
||||
if (change && found)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue