FIX: copy and override HMS files
jira: [STUDIO-9570] Change-Id: Id2a1002a484e40c835d3dc54262ca0e9c84d20c6
This commit is contained in:
parent
fcb8e8deaf
commit
1e6e376a15
|
@ -127,7 +127,7 @@ int HMSQuery::download_hms_related(const std::string& hms_type, const std::strin
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_copy_dir(const fs::path& from_dir, const fs::path& to_dir) /* the copy will not override files*/
|
_copy_dir(const fs::path& from_dir, const fs::path& to_dir) /* copy and override with local files*/
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -147,8 +147,13 @@ _copy_dir(const fs::path& from_dir, const fs::path& to_dir) /* the copy will not
|
||||||
const fs::path &relative_path = fs::relative(source_path, from_dir);
|
const fs::path &relative_path = fs::relative(source_path, from_dir);
|
||||||
const fs::path &dest_path = to_dir / relative_path;
|
const fs::path &dest_path = to_dir / relative_path;
|
||||||
|
|
||||||
if (fs::is_regular_file(source_path) && !fs::exists(dest_path))
|
if (fs::is_regular_file(source_path))
|
||||||
{
|
{
|
||||||
|
if (fs::exists(dest_path))
|
||||||
|
{
|
||||||
|
fs::remove(dest_path);
|
||||||
|
}
|
||||||
|
|
||||||
copy_file(source_path, dest_path);
|
copy_file(source_path, dest_path);
|
||||||
}
|
}
|
||||||
else if (fs::is_directory(source_path))
|
else if (fs::is_directory(source_path))
|
||||||
|
|
Loading…
Reference in New Issue