Skip to content

Commit

Permalink
mxgrub: Remove redundant exit status checks
Browse files Browse the repository at this point in the history
Callers of the function sys() don't need to check the return value,
because sys() doesn't return at all if the external command fails.

Remove `and exit 1` after sys().

Closes #52
  • Loading branch information
donald committed Aug 20, 2019
1 parent 5ac06aa commit c881fbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,18 @@ sub cmd_install {
update_grub_cfg();

if (has_esp) {
sys 'mount','-L','ESP','/boot/efi' and exit 1;
sys 'mount','-L','ESP','/boot/efi';
if (-d '/boot/efi/EFI/grub/grubx64.efi') {
print "GRUB for UEFI is already installed.\n";
}
else {
sys 'grub-install','--target=x86_64-efi','--no-nvram',$root_disk and exit 1;
sys 'grub-install','--target=x86_64-efi','--no-nvram',$root_disk;
}
sys 'umount','/boot/efi' and exit 1;
sys 'umount','/boot/efi';
}

if ($mbr_type ne 'GRUB') {
sys 'grub-install','--target=i386-pc',$root_disk and exit 1;
sys 'grub-install','--target=i386-pc',$root_disk;
} else {
print "GRUB is already installed in MBR.\n";
}
Expand Down

0 comments on commit c881fbb

Please sign in to comment.