Added snapshot. Part 2

This commit is contained in:
Alexey Berezhok
2025-12-24 23:20:41 +03:00
parent 8b4410eee7
commit 5dd481a81c
3 changed files with 9 additions and 6 deletions

View File

@@ -517,10 +517,13 @@ class ProjectsActions
end
def delete_snapshot(id, snap)
proj_path = get_project_path(id)
snap_path = get_project_snap(id, snap)
if File.exist?(snap_path)
FileUtils.rm_rf(snap_path)
snap_path_base = File.join(proj_path, PROJECTS_STRUCTURE[:SNAP])
unless snap_path == snap_path_base || "#{snap_path}/" == snap_path_base || snap_path == "#{snap_path_base}/"
if File.exist?(snap_path)
FileUtils.rm_rf(snap_path)
end
end
end
end