Merge pull request #4251 from reitermarkus/must-succeed

Moving and copying must succeed.
This commit is contained in:
Markus Reiter 2018-06-01 14:17:21 +02:00 committed by GitHub
commit e6648af656
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ module Hbc
if target.parent.writable?
FileUtils.move(source, target)
else
command.run("/bin/mv", args: [source, target], sudo: true)
command.run!("/bin/mv", args: [source, target], sudo: true)
end
add_altname_metadata(target, source.basename, command: command)
@ -68,7 +68,7 @@ module Hbc
if target.parent.writable?
FileUtils.cp_r(target, source)
else
command.run("/bin/cp", args: ["-r", target, source], sudo: true)
command.run!("/bin/cp", args: ["-r", target, source], sudo: true)
end
delete(target, force: force, command: command, **options)