Skip to content

Commit

Permalink
Fixed wrong deletion method
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgurance committed Dec 7, 2024
1 parent 7e7da37 commit 732f911
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ISM/CommandLine.cr
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,16 @@ module ISM
filesForRemoval = requestedVersion.installedFiles
end

begin
filesForRemoval.each do |file|
filesForRemoval.each do |file|
if File.exists?
FileUtils.rm_r(file)
end
end

FileUtils.rm_r(software.installedDirectoryPath+"/"+software.version)
FileUtils.rm_r(software.installedDirectoryPath+"/"+software.version)

if Dir.empty?(software.installedDirectoryPath)
FileUtils.rm_r(software.installedDirectoryPath)
end
#Deletion of non existent file is not critical
rescue
if Dir.empty?(software.installedDirectoryPath)
FileUtils.rm_r(software.installedDirectoryPath)
end

#Update the ISM instance to make sure the database is up to date and avoiding to reload everything
Expand Down

0 comments on commit 732f911

Please sign in to comment.