From 2ed56b50a4164aa6f4c039187991732d41e4b52d Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 27 Sep 2018 18:31:08 +0200 Subject: [PATCH] Ensure directory paths are created from stage -> prod --- lib/remote/apilistener-filesync.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index f1d590293..1ae461d74 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -369,7 +369,12 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr, Log(LogCritical, "ApiListener") << "Copying file '" << path << "' from config sync staging to production directory."; - Utility::CopyFile(GetApiZonesStageDir() + path, GetApiZonesDir() + path); + String stagePath = GetApiZonesStageDir() + path; + String currentPath = GetApiZonesDir() + path; + + Utility::MkDirP(Utility::DirName(currentPath), 0755); + + Utility::CopyFile(stagePath, currentPath); } if (reload)