mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Ensure package repositories are available before installing or doing updates
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! curl -s --connect-timeout 10 --head -A "omarchy-update" -o /dev/null "https://aur.archlinux.org/"; then
|
||||
gum spin --spinner "globe" --title "The AUR package repository is currently unavailable, please try again later" -- sleep 2 && exit 1
|
||||
fi
|
||||
27
bin/omarchy-pkg-repos-accessible
Executable file
27
bin/omarchy-pkg-repos-accessible
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Ensuring all package repositories are available..."
|
||||
|
||||
# Ensure Arch mirror is available
|
||||
while true; do
|
||||
if curl -sfI -A "omarchy-update" \
|
||||
https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db >/dev/null; then
|
||||
break
|
||||
else
|
||||
echo -e "\e[31mArch mirror is unavailable. Retrying in 10 seconds...\e[0m"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
||||
# Ensure AUR is available
|
||||
while true; do
|
||||
if curl -sfI --connect-timeout 30 -A "omarchy-update" https://aur.archlinux.org >/dev/null &&
|
||||
curl -sf -A "omarchy-update" \
|
||||
"https://aur.archlinux.org/rpc/?v=5&type=info&arg=base" |
|
||||
jq -e '.type=="info"' >/dev/null; then
|
||||
break
|
||||
else
|
||||
echo -e "\e[31mAUR is unavailable. Retrying in 10 seconds...\e[0m"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
omarchy-pkg-repos-accessible
|
||||
omarchy-snapshot create || [ $? -eq 127 ]
|
||||
omarchy-update-git
|
||||
omarchy-migrate
|
||||
|
||||
Reference in New Issue
Block a user