From 08f89ee4617d20a7942607ce12df241afe9b4997 Mon Sep 17 00:00:00 2001 From: Oleg Orlov Date: Thu, 14 May 2026 11:42:45 +0300 Subject: [PATCH] Show error if internet is off or broken --- lib/utils.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/utils.sh b/lib/utils.sh index d28f850..db7a61e 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -48,7 +48,11 @@ download_ruby_build() { rm -rf "$build_dir" # Clone down and checkout the correct ruby-build version - git clone https://github.com/rbenv/ruby-build.git "$build_dir" >/dev/null 2>&1 + local git_error + git_error=$(git clone https://github.com/rbenv/ruby-build.git "$build_dir" 2>&1) || { + rm -rf "$build_dir" + errorexit "Failed to download ruby-build: $git_error\nPlease check your internet connection." + } ( cd "$build_dir" || exit git checkout "$RUBY_BUILD_TAG" >/dev/null 2>&1