xplayer-ota/test-direnv.sh
2026-02-16 08:23:38 +08:00

32 lines
843 B
Bash
Executable File

#!/bin/zsh
echo "=== Testing direnv setup ==="
echo ""
echo "1. Shell: $SHELL"
echo "2. Current directory: $(pwd)"
echo ""
echo "3. Checking if direnv hook is loaded:"
type _direnv_hook 2>/dev/null && echo " ✓ direnv hook found" || echo " ✗ direnv hook NOT found"
echo ""
echo "4. Checking .envrc status:"
direnv status | grep -E "(Found RC|allowed)"
echo ""
echo "5. Current QINIU_BUCKET value:"
echo " QINIU_BUCKET=${QINIU_BUCKET:-[not set]}"
echo ""
echo "6. Manually trigger direnv:"
eval "$(direnv export zsh 2>&1)"
echo " QINIU_BUCKET=${QINIU_BUCKET:-[not set]}"
echo ""
echo "=== Instructions ==="
echo "If you don't see direnv loading automatically:"
echo "1. Exit and re-enter the directory: cd .. && cd -"
echo "2. Or reload shell: exec zsh"
echo "3. You should see: direnv: loading ~/Projects/xplayer-ota/.envrc"