fix: handle 'fusermount -u' return codes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Glenn Y. Rolland 2023-11-20 12:37:31 +01:00
parent bba30c5222
commit 283606c280

View file

@ -21,7 +21,13 @@ module GX
module GenericFilesystem
def unmount
system("fusermount -u #{mount_dir.shellescape}")
fusermount_status = $?
if fusermount_status.success? == 0
puts "Filesystem #{name} is now closed.".colorize(:green)
else
puts "Error: Unable to unmount filesystem #{name} (exit code: #{fusermount_status.exit_code}).".colorize(:red)
end
end
def mount(&block)