Merge pull request #9858 from OatmealDome/updater-fail

UpdaterCommon: Fix code signing error after updating on macOS
This commit is contained in:
Léo Lam 2021-07-06 02:33:05 +02:00 committed by GitHub
commit 683807abce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,7 +431,7 @@ bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update,
std::string content_filename = HexEncode(op.new_hash.data(), op.new_hash.size());
fprintf(log_fp, "Updating file %s from content %s...\n", op.filename.c_str(),
content_filename.c_str());
if (!File::Copy(temp_path + DIR_SEP + content_filename, path))
if (!File::Rename(temp_path + DIR_SEP + content_filename, path))
{
fprintf(log_fp, "Could not update file %s.\n", op.filename.c_str());
return false;