inject.sh: simplify. and remove unnecessary check

checking whether archivename is empty isn't needed, because
the case/switch afterward would catch this condition.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-27 11:32:11 +01:00
parent bc9ea0a1aa
commit 46f7d48c8d
+1 -3
View File
@@ -38,7 +38,7 @@ inject()
esac
[ "$new_mac" = "keep" ] && new_mac=""
check_release
x_ e "$archive" f && check_release
check_target && patch_release
[ "$xchanged" = "y" ] && remktar
@@ -52,10 +52,8 @@ inject()
check_release()
{
[ -L "$archive" ] && err "'$archive' is a symlink"
e "$archive" f missing && err "'$archive' missing"
archivename="`basename "$archive"`" || err "Can't get '$archive' name"
[ -z "$archivename" ] && err "Can't determine archive name"
case "$archivename" in
*_src.tar.xz) err "'$archive' is a src archive, silly!" ;;