@cryptotaxi247 / kubo / commits / 49b90a075

dist_get: handle 404 correctly

This prevents a 404 page getting piped into tar. It's also adding the openbsd http(s) client `ftp`. License: MIT Signed-off-by: kpcyrd <git@rxv.cc>

kpcyrd committed Apr 27, 2017 at 00:26 UTC 49b90a07541610eb1ba920054a738f5fa4c33fd2
1 file changed +2 -1
bin/dist_get
+2 -1
@@ -44,9 +44,10 @@ download() {
44 fi
45
46 try_download "$dl_url" "$dl_output" "wget '$dl_url' -O '$dl_output'" && return
47 - try_download "$dl_url" "$dl_output" "curl --silent '$dl_url' > '$dl_output'" && return
47 + try_download "$dl_url" "$dl_output" "curl --silent --fail --output '$dl_output' '$dl_url'" && return
48 try_download "$dl_url" "$dl_output" "fetch '$dl_url' -o '$dl_output'" && return
49 try_download "$dl_url" "$dl_output" "http '$dl_url' > '$dl_output'" && return
50 + try_download "$dl_url" "$dl_output" "ftp -o '$dl_output' '$dl_url'" && return
51
52 die "Unable to download $dl_url. exiting."
53 }