Skip to content

Commit 64f14fc

Browse files
committed
fix for registries doctor because of weird config get behavior
1 parent 55790d4 commit 64f14fc

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

lib/registries_doctor.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,34 @@
66

77
fmt_header "Private Registries (Bundler)"
88

9-
if cmd_exists bundle; then
9+
# Read ~/.bundle/config directly instead of using `bundle config get` because
10+
# Bundler creates/modifies the config file as a side effect of any config
11+
# command, violating the doctor's read-only contract.
12+
BUNDLE_CONFIG="$HOME/.bundle/config"
13+
14+
if [ -f "$BUNDLE_CONFIG" ]; then
1015
# Check Sidekiq Enterprise (contribsys) credential
11-
if bundle config get enterprise.contribsys.com 2>/dev/null | grep -q "Set for"; then
16+
if grep -q "BUNDLE_ENTERPRISE__CONTRIBSYS__COM" "$BUNDLE_CONFIG" 2>/dev/null; then
1217
check_pass "bundler: enterprise.contribsys.com is configured"
1318
else
1419
check_fail "bundler: enterprise.contribsys.com is not configured"
1520
fi
1621

1722
# Check GitHub Packages gem registry credential
18-
if bundle config get rubygems.pkg.github.com 2>/dev/null | grep -q "Set for"; then
23+
if grep -q "BUNDLE_RUBYGEMS__PKG__GITHUB__COM" "$BUNDLE_CONFIG" 2>/dev/null; then
1924
check_pass "bundler: rubygems.pkg.github.com is configured"
2025
else
2126
check_fail "bundler: rubygems.pkg.github.com is not configured"
2227
fi
2328

2429
# Check GitHub git sources credential
25-
if bundle config get github.com 2>/dev/null | grep -q "Set for"; then
30+
if grep -q "BUNDLE_GITHUB__COM" "$BUNDLE_CONFIG" 2>/dev/null; then
2631
check_pass "bundler: github.com is configured"
2732
else
2833
check_fail "bundler: github.com is not configured"
2934
fi
3035
else
31-
check_fail "Cannot check Bundler registries — bundle is not installed"
36+
check_fail "Bundler config not found at $BUNDLE_CONFIG (run setup.sh)"
3237
fi
3338

3439
fmt_header "Private Registries (Yarn)"

0 commit comments

Comments
 (0)