From ce1460dd98185f80db479c7dc7ca19026149a255 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 24 Dec 2015 00:37:32 +0100 Subject: Add support for changing the `diff` command via an environment variable While the file arguments remain fixed the actual `diff` application and its output style can be changed using the `CHANGE_LOG_DIFF_CMD` environment variable. --- src/change_log.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/change_log.cc') diff --git a/src/change_log.cc b/src/change_log.cc index c592f20..44a6046 100644 --- a/src/change_log.cc +++ b/src/change_log.cc @@ -23,7 +23,13 @@ void init() { logger = std::make_unique(STDERR_FILENO); } - tracker = std::make_unique(logger.get()); + if ( getenv("CHANGE_LOG_DIFF_CMD") != NULL ) { + tracker = std::make_unique( + logger.get(), getenv("CHANGE_LOG_DIFF_CMD") + ); + } else { + tracker = std::make_unique(logger.get()); + } } ssize_t write(int fd, const void* buffer, size_t count) { -- cgit v1.2.3