|
6 | 6 |
|
7 | 7 | fmt_header "Private Registries (Bundler)" |
8 | 8 |
|
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 |
10 | 15 | # 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 |
12 | 17 | check_pass "bundler: enterprise.contribsys.com is configured" |
13 | 18 | else |
14 | 19 | check_fail "bundler: enterprise.contribsys.com is not configured" |
15 | 20 | fi |
16 | 21 |
|
17 | 22 | # 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 |
19 | 24 | check_pass "bundler: rubygems.pkg.github.com is configured" |
20 | 25 | else |
21 | 26 | check_fail "bundler: rubygems.pkg.github.com is not configured" |
22 | 27 | fi |
23 | 28 |
|
24 | 29 | # 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 |
26 | 31 | check_pass "bundler: github.com is configured" |
27 | 32 | else |
28 | 33 | check_fail "bundler: github.com is not configured" |
29 | 34 | fi |
30 | 35 | 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)" |
32 | 37 | fi |
33 | 38 |
|
34 | 39 | fmt_header "Private Registries (Yarn)" |
|
0 commit comments