mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-04 13:05:00 +08:00
Remove redundant check
Running a command and then checking its exit status $? against 0 is redundant. Instead of just checking the exit code of a command, it checks the exit code of a command that checks the exit code of a command.
This commit is contained in:
@@ -245,8 +245,7 @@ trim() {
|
||||
snapshot_list()
|
||||
{
|
||||
# Query info from snapper if it is installed
|
||||
type snapper >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
if type snapper >/dev/null 2>&1; then
|
||||
if [ -s "/etc/snapper/configs/$snapper_config" ]; then
|
||||
printf "Info: snapper detected, using config '$snapper_config'\n" >&2
|
||||
local snapper_ids=($(snapper --no-dbus -t 0 -c "$snapper_config" list --disable-used-space | tail -n +3 | cut -d'|' -f 1))
|
||||
|
||||
Reference in New Issue
Block a user