diff --git a/src/laminar.cpp b/src/laminar.cpp index c164c7e..9cf1fc9 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -432,12 +432,19 @@ void Laminar::assignNewJobs() { run->lastResult = RunState(result); }); + // create a working directory (different to a workspace!) fs::path wd = fs::path(homeDir)/"run"/run->name/std::to_string(run->build); - if(!fs::is_directory(wd) && !fs::create_directory(wd)) { + if(!fs::create_directory(wd)) { KJ_LOG(ERROR, "Could not create working directory", wd.string()); break; } run->wd = wd.string(); + // create an archive directory + fs::path archive = fs::path(homeDir)/"archive"/run->name/std::to_string(run->build); + if(!fs::create_directories(archive)) { + KJ_LOG(ERROR, "Could not create archive directory", archive.string()); + break; + } // add scripts fs::path cfgDir = fs::path(homeDir)/"cfg"; diff --git a/src/run.cpp b/src/run.cpp index cf1b84e..0a3cc71 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -87,6 +87,7 @@ bool Run::step() { setenv("lResult", to_string(result).c_str(), true); setenv("lLastResult", to_string(lastResult).c_str(), true); setenv("lWorkspace", (fs::path(laminarHome)/"run"/name/"workspace").string().c_str(), true); + setenv("lArchive", (fs::path(laminarHome)/"archive"/name/buildNum.c_str()).string().c_str(), true); for(auto& pair : params) { setenv(pair.first.c_str(), pair.second.c_str(), false); }