Add curl option to retry download in repackage script

This commit is contained in:
Francesco Abbate 2021-01-20 15:41:12 +01:00
parent c2cccf0173
commit 0d6fbe23c4
1 changed files with 5 additions and 3 deletions

View File

@ -15,7 +15,7 @@ copy_directory_from_repo () {
lite_copy_third_party_modules () {
local build="$1"
curl --insecure -L "https://github.com/rxi/lite-colors/archive/master.zip" -o "$build/rxi-lite-colors.zip"
curl --retry 5 --retry-delay 3 --insecure -L "https://github.com/rxi/lite-colors/archive/master.zip" -o "$build/rxi-lite-colors.zip" || exit 1
mkdir -p "$build/third/data/colors" "$build/third/data/plugins"
unzip -qq "$build/rxi-lite-colors.zip" -d "$build"
mv "$build/lite-colors-master/colors" "$build/third/data"
@ -36,15 +36,17 @@ while [ ! -z ${1+x} ]; do
esac
done
wget="wget --retry-connrefused --waitretry=1 --read-timeout=20 --no-check-certificate"
workdir=".repackage"
rm -fr "$workdir" && mkdir "$workdir" && pushd "$workdir"
fetch_packages_from_github () {
assets=($(wget --no-check-certificate -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4))
assets=($($wget -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4))
for url in "${assets[@]}"; do
echo "getting: $url"
wget -q --no-check-certificate "$url"
$wget -q "$url" || exit 1
done
}