Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New+ Update last modified date to now for all templates created #36133

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Now also set last update for directories. Thank you htcfreek!
cgaarden committed Dec 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8a520b766fc8e70e6ee15278237169ee4b541301
14 changes: 5 additions & 9 deletions src/modules/NewPlus/NewShellExtensionContextMenu/new_utilities.h
Original file line number Diff line number Diff line change
@@ -346,18 +346,14 @@ namespace newplus::utilities
inline void update_last_write_time(const std::filesystem::path path)
{
const std::filesystem::file_time_type now = std::filesystem::file_time_type::clock::now();
if (std::filesystem::is_regular_file(path))
{
std::filesystem::last_write_time(path, now);
}
else if (std::filesystem::is_directory(path))

std::filesystem::last_write_time(path, now);

if (std::filesystem::is_directory(path))
{
for (const auto& entry : std::filesystem::recursive_directory_iterator(path))
{
if (std::filesystem::is_regular_file(entry.path()))
{
std::filesystem::last_write_time(entry.path(), now);
}
std::filesystem::last_write_time(entry.path(), now);
}
}
}