Add a script for testing curl | zsh resilience and mention it in the README
This commit is contained in:
parent
a324ca62c8
commit
5178802725
3 changed files with 30 additions and 2 deletions
12
_scripts/partial-dl-test
Executable file
12
_scripts/partial-dl-test
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env zsh
|
||||
actualSize=$(wc -c < $1)
|
||||
|
||||
for (( size = 0; size < actualSize; size++ )); do
|
||||
head -c$size $1 | env -i HOME=$HOME/test zsh 2>/dev/null
|
||||
if [[ -d $HOME/test ]]; then
|
||||
percent=$(( size * 100 / actualSize ))
|
||||
echo "dots still ran with only $size bytes available, " \
|
||||
"$percent% of its full $actualSize bytes!" 2>/dev/null
|
||||
exit $size
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue