fixes bug with static folder copying where code would crash if files already existed in folder

This commit is contained in:
Rosia E Evans 2023-09-29 12:40:04 +01:00
parent 0d116acd17
commit dc7066b559
4 changed files with 5 additions and 40 deletions

View file

@ -37,7 +37,9 @@ std::string getArg(int argc, char* argv[], std::string argIdString)
void copyFolderAndContents(std::string inUrl, std::string outUrl)
{
std::filesystem::copy(inUrl, outUrl, std::filesystem::copy_options::recursive);
std::filesystem::copy_options opts = std::filesystem::copy_options::update_existing |
std::filesystem::copy_options::recursive;
std::filesystem::copy(inUrl, outUrl, opts);
}
/*
@ -65,3 +67,4 @@ int main(int argc, char* argv[])
// TODO: get images and resources moved across to output
// TODO: nav sections :eww:
// TODO: copy static pages over
// TODO: code doesnt copy moomin