summaryrefslogtreecommitdiff
path: root/src/task_fn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_fn.cc')
-rw-r--r--src/task_fn.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/task_fn.cc b/src/task_fn.cc
index 1ff72f9..b6b50ea 100644
--- a/src/task_fn.cc
+++ b/src/task_fn.cc
@@ -74,10 +74,16 @@ int TaskFn::runInner()
std::cout << output << std::flush;
}
- return config.function(sourceFile.string(),
- targetFile().string(),
- config,
- settings);
+ auto res = config.function(sourceFile.string(),
+ targetFile().string(),
+ config,
+ settings);
+ if(res != 0)
+ {
+ std::filesystem::remove(targetFile());
+ }
+
+ return res;
}
int TaskFn::clean()