mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Overwrite changelog only when modified
This commit is contained in:
parent
43bca1f878
commit
80b5d41eb6
@ -2331,6 +2331,22 @@ void Downloader::saveChangelog(const std::string& changelog, const std::string&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if changelog matches current changelog
|
||||||
|
if (boost::filesystem::exists(filepath))
|
||||||
|
{
|
||||||
|
std::ifstream ifs(filepath);
|
||||||
|
if (ifs)
|
||||||
|
{
|
||||||
|
std::string current_changelog((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
|
||||||
|
ifs.close();
|
||||||
|
if (changelog == current_changelog)
|
||||||
|
{
|
||||||
|
std::cout << "Changelog unchanged. Skipping: " << filepath << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::ofstream ofs(filepath);
|
std::ofstream ofs(filepath);
|
||||||
if (ofs)
|
if (ofs)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user