From 616f3051e67d378c410ac5fdf869864122f72cdd Mon Sep 17 00:00:00 2001 From: "njzjz-bot (driven by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5))[bot]" <48687836+njzjz-bot@users.noreply.github.com> Date: Sun, 31 May 2026 13:20:40 +0000 Subject: [PATCH] fix(installer): tolerate country lookup failures Avoid exiting under set -e when ipinfo country detection is unavailable, and allow overriding the detected country with ABACUS1S_COUNTRY. Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5) --- abacus1s.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/abacus1s.sh b/abacus1s.sh index 6347c23..5c0b9ca 100755 --- a/abacus1s.sh +++ b/abacus1s.sh @@ -29,16 +29,28 @@ ABACUS1S_BIN_PATH=$ABACUS1S_HOME/bin # 1. check the location of the machine ((progress++)) || : -country=$(curl -s https://ipinfo.io/country) -logging "Location: ${country}" -if [ "$country" = "CN" ] -then - conda_channel="https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/" - export PIXI_REPOURL=https://ghfast.top/https://github.com/prefix-dev/pixi +if [[ -v ABACUS1S_COUNTRY ]]; then + country=${ABACUS1S_COUNTRY} else - conda_channel="conda-forge" + country=$(curl -fsSL --connect-timeout 5 --max-time 10 https://ipinfo.io/country || :) fi +case "${country}" in + CN) + logging "Location: ${country}" + conda_channel="https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/" + export PIXI_REPOURL=https://ghfast.top/https://github.com/prefix-dev/pixi + ;; + "") + logging "Location detection failed; falling back to conda-forge" + conda_channel="conda-forge" + ;; + *) + logging "Location: ${country}" + conda_channel="conda-forge" + ;; +esac + # 2. install pixi ((progress++)) logging "Install pixi"