mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Allow package removal to not error out on missing files, in case of files from a package having been manually removed (#9625)
* Allow package removal to not error out on missing files. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use FileUtils to allow Exception option Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
57dca3bde9
commit
e133fa9430
@@ -36,7 +36,7 @@ class Command
|
||||
puts "#{line} is in another package. It will not be removed during the removal of #{pkg.name}.".orange
|
||||
else
|
||||
puts "Removing file #{line}".yellow if verbose
|
||||
FileUtils.remove_file line
|
||||
FileUtils.remove_file line, exception: false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ class Command
|
||||
File.foreach(File.join(CREW_META_PATH, "#{pkg.name}.directorylist"), chomp: true) do |line|
|
||||
next unless Dir.exist?(line) && Dir.empty?(line) && line.include?(CREW_PREFIX)
|
||||
puts "Removing directory #{line}".yellow if verbose
|
||||
Dir.rmdir line
|
||||
FileUtils.remove_dir line, exception: false
|
||||
end
|
||||
|
||||
# Remove the file and directory lists.
|
||||
|
||||
Reference in New Issue
Block a user