Commit 1646bbc8 authored by Domen Vrankar's avatar Domen Vrankar

Create destination directory for symlink

If destination directory doesn't exist
symlink() command doesn't create one
so it should be created beforehand (same
as when calling CopyFileAlways) instead
of treating missing destination dir as
an error.
parent 7e9f7b7b
Pipeline #52820 passed with stage
......@@ -3098,6 +3098,9 @@ bool SystemTools::CreateSymlink(const std::string&, const std::string&)
bool SystemTools::CreateSymlink(const std::string& origName,
const std::string& newName)
{
// Create destination directory if it doesn't exist
SystemTools::MakeDirectory(SystemTools::GetFilenamePath(newName));
return symlink(origName.c_str(), newName.c_str()) >= 0;
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment