mirror of
https://github.com/jorgebucaran/fisher
synced 2024-06-28 23:01:50 +02:00
self-update: better network error handling; fix #580
A power outage could corrupt a `fisher self-update`. This change prevents fisher from overwriting itself to death.
This commit is contained in:
parent
994506e594
commit
510e6254ee
|
@ -157,7 +157,7 @@ function _fisher_self_update -a file
|
|||
echo "fetching $url" >&2
|
||||
command curl -s "$url?nocache" >$file.
|
||||
|
||||
set -l next_version (command awk '{ print $4 } { exit }' <$file.)
|
||||
set -l next_version (command awk '$4 ~ /^[0-9]+\.[0-9]+\.[0-9]+$/ { print v=$4 } { exit !v }' <$file.)
|
||||
switch "$next_version"
|
||||
case "" $fisher_version
|
||||
command rm -f $file.
|
||||
|
|
Loading…
Reference in a new issue