diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-12 11:19:42 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-12 11:19:42 +0100 |
| commit | c3e2d8c8bc3dfeb1472cb28affee196ddbe2fa55 (patch) | |
| tree | 3a53d37db26b239d194e73d52be377e027339165 /include/get.sh | |
| parent | b094c60a39e944e5fd7d33a3948b3b0d83c02971 (diff) | |
get.sh: simplify xbget
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/get.sh')
| -rw-r--r-- | include/get.sh | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/include/get.sh b/include/get.sh index bc47a075..862bc330 100644 --- a/include/get.sh +++ b/include/get.sh @@ -139,25 +139,13 @@ xbget() [ "$1" != "curl" ] && [ "$1" != "copy" ] && [ "$1" != "git" ] && \ err "Bad dlop (arg 1)" "xbget" "$@" - for url in "$2" "$3" - do - if [ -z "$url" ]; then + for url in "$2" "$3"; do + [ -z "$url" ] && \ err "empty URL given in" "xbget" "$@" - elif ! try_fetch "$url" "$@"; then + try_fetch "$url" "$@" || \ continue - fi - - case "$1" in - git) - [ ! -d "$4" ] && \ - continue - ;; - *) - [ ! -f "$4" ] && \ - continue - ;; - esac - return 0 # successful download/copy + [ -e "$4" ] && \ + return 0; : # successful download/copy done err "failed to download file/repository" "xbget" "$@"; : |
