Skip to content

Commit 12b3270

Browse files
authored
Update vulkan_prebuilt_helpers.sh
alternate strategy to avoid caching curl fail-on-body responses
1 parent 61e6a1e commit 12b3270

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vulkan_prebuilt_helpers.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function download_vulkan_installer() {
2222
local filename=$(_os_filename $os)
2323
local url=https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VERSION/$os/$filename?Human=true
2424
echo "_download_os_installer $os $filename $url" >&2
25-
if [[ -f $filename && $(stat -c %s $filename) -gt 1048576 ]] ; then
25+
if [[ -f $filename ]] ; then
2626
echo "using cached: $filename" >&2
2727
else
28-
curl --fail-with-body -s -L -o $filename $url || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $url >&2 ; exit 32 ; }
29-
test -f $filename
30-
test $(stat -c %s $filename) -gt 1048576
28+
curl --fail-with-body -s -L -o ${filename}.tmp $url || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $url >&2 ; exit 32 ; }
29+
test -f ${filename}.tmp
30+
mv -v ${filename}.tmp ${filename}
3131
fi
3232
ls -lh $filename >&2
3333
}

0 commit comments

Comments
 (0)