-
-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
- Installation Issues
- Script Execution Problems
- Shell Completion Issues
- Git Integration Problems
- Performance Issues
- Configuration Problems
- Common Error Messages
- Debug Mode
- Getting Help
Problem: The installation script exits with an error.
Solutions:
-
Check prerequisites:
# Verify bash version bash --version # Need 4.0+ # Check Git git --version # Need 2.0+ # Check curl curl --version
-
Manual installation:
# Create directories mkdir -p ~/.local/bin ~/.config/dotrun/{bin,docs,templates} # Download dr curl -o ~/.local/bin/dr \ https://raw.githubusercontent.com/jvPalma/dotrun/master/dr chmod +x ~/.local/bin/dr # Initialize Git cd ~/.config/dotrun && git init
-
Permission issues:
# Ensure directories are writable chmod 755 ~/.local/bin chmod 755 ~/.config
Problem: After installation, dr command is not found.
Solutions:
-
Add to PATH:
# Add to ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish export PATH="$HOME/.local/bin:$PATH" # Reload shell source ~/.bashrc # or ~/.zshrc
-
Verify installation:
# Check if dr exists ls -la ~/.local/bin/dr # Test direct execution ~/.local/bin/dr --version
-
Check PATH:
echo $PATH | tr ':' '\n' | grep -E "(local/bin|\.local/bin)"
Problem: Tab completion doesn't work after installation.
Solutions:
-
Bash:
# Check if completion file exists ls ~/.config/dotrun/completions/drun-completion.bash # Source in ~/.bashrc echo 'source ~/.config/dotrun/completions/drun-completion.bash' >>~/.bashrc source ~/.bashrc
-
Zsh:
# Add to fpath in ~/.zshrc echo 'fpath=(~/.config/dotrun/completions $fpath)' >>~/.zshrc echo 'autoload -U compinit && compinit' >>~/.zshrc source ~/.zshrc
-
Fish:
# Copy completion file cp ~/.config/dotrun/completions/dr.fish \ ~/.config/fish/completions/
Problem: Scripts fail with "Permission denied" error.
Solutions:
-
Make executable:
chmod +x ~/.config/dotrun/bin/scriptname # Fix all scripts find ~/.config/dotrun/bin -type f -exec chmod +x {} \;
-
Check shebang:
# Ensure first line is correct head -1 ~/.config/dotrun/bin/scriptname # Should be: #!/usr/bin/env bash
Problem: dr scriptname returns "script not found".
Solutions:
-
Verify location:
# List all scripts dr -l # Check specific script ls -la ~/.config/dotrun/bin/scriptname
-
Check categories:
# If script is in category dr category/scriptname # List category scripts dr -l category/
-
Case sensitivity:
# Scripts are case-sensitive dr MyScript # Different from dr myscript
Problem: Script exits without output or error.
Solutions:
-
Enable debug mode:
# Run with bash debug bash -x ~/.config/dotrun/bin/scriptname # Or set in script set -x # Enable debug set -e # Exit on error
-
Check exit codes:
dr scriptname echo $? # Check exit code
-
Add error handling:
#!/usr/bin/env bash set -euo pipefail trap 'echo "Error on line $LINENO"' ERR
Problem: Completions don't work even after sourcing.
Solutions:
-
Check bash-completion:
# Install bash-completion package # macOS brew install bash-completion # Ubuntu/Debian sudo apt install bash-completion
-
Verify completion function:
# Check if function is loaded type _dr_completions
-
Manual load:
# Force reload source ~/.config/dotrun/completions/drun-completion.bash complete -p dr # Verify
Problem: Tab completion is slow.
Solutions:
-
Reduce script count:
# Archive unused scripts mkdir ~/.config/dotrun/archive mv ~/.config/dotrun/bin/old-* ~/.config/dotrun/archive/
-
Optimize completion:
# Use simple completion export DR_SIMPLE_COMPLETION=1
Problem: Git commands fail in DotRun directory.
Solutions:
cd ~/.config/dotrun
git init
git add .
git commit -m "Initial commit"Problem: Conflicts when syncing with team repository.
Solutions:
-
Resolve conflicts:
# See conflicts git status # Edit conflicted files dr set conflicted-script # Mark resolved git add bin/conflicted-script git commit
-
Prevent conflicts:
# Use branches git checkout -b personal # Keep team scripts separate git checkout team-scripts -- bin/team/
Problem: dr -l takes too long.
Solutions:
-
Reduce search scope:
# List specific category dr -l git/ # Limit depth export DR_MAX_DEPTH=2
-
Clean up:
# Remove non-scripts find ~/.config/dotrun/bin -type f ! -executable -delete # Remove empty directories find ~/.config/dotrun/bin -type d -empty -delete
Problem: DotRun operations use too much memory.
Solutions:
-
Limit operations:
# Process files in batches export DR_BATCH_SIZE=50
-
Clear cache:
# If using completion cache rm -rf ~/.cache/dotrun/
Problem: Scripts can't access configured variables.
Solutions:
-
Check sourcing:
# In script source "$DR_HOME/env" # Or [[ -f "$DR_HOME/env" ]] && source "$DR_HOME/env"
-
Export variables:
# In env file export VAR_NAME="value" # Don't forget export!
Problem: Configuration files cause errors.
Solutions:
-
Validate bash syntax:
bash -n ~/.config/dotrun/env -
Check YAML/JSON:
# Validate YAML yamllint ~/.config/dotrun/config.yml # Validate JSON jq . ~/.config/dotrun/config.json
Error: /usr/bin/env: bad interpreter: No such file or directory
Solution:
# Fix line endings (Windows issue)
dos2unix ~/.config/dotrun/bin/scriptname
# Or use sed
sed -i 's/\r$//' ~/.config/dotrun/bin/scriptnameError: Bash syntax error in script.
Solution:
# Check with shellcheck
shellcheck ~/.config/dotrun/bin/scriptname
# Common issues:
# - Missing quotes around variables
# - Unmatched brackets or parentheses
# - Windows line endingsError: Script can't find commands.
Solution:
# Use full paths or ensure PATH
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
# Or use command -v
if ! command -v sometool &>/dev/null; then
echo "sometool is required"
exit 1
fiSet debug for all DotRun operations:
# Enable debug
export DR_DEBUG=1
# Verbose output
export DR_VERBOSE=1
# Trace execution
export DR_TRACE=1# Method 1: Bash debug
bash -x ~/.config/dotrun/bin/scriptname
# Method 2: In script
#!/usr/bin/env bash
[[ "${DEBUG:-}" == "1" ]] && set -x
# Method 3: Temporary
DEBUG=1 dr scriptnameAdd debug helpers:
debug() {
[[ "${DEBUG:-}" == "1" ]] && echo "DEBUG: $*" >&2
}
debug "Variable X = $X"
debug "Entering function Y"When reporting issues, include:
# System info
dr --info >dr-info.txt
# Version
dr --version >>dr-info.txt
# Shell version
echo $SHELL >>dr-info.txt
$SHELL --version >>dr-info.txt
# Script list
dr -l >>dr-info.txt
# Error output
dr problematic-script 2>&1 | tee error.log- GitHub Issues: Report bugs
- Discussions: Ask questions
- Wiki: Read documentation
- PATH includes
~/.local/bin - Scripts are executable (
chmod +x) - Shell completions are sourced
- Git is initialized in
~/.config/dotrun - No syntax errors (
shellcheck) - Correct line endings (Unix, not Windows)
- Dependencies are installed
- Environment variables are exported
Still having issues? Open a GitHub issue with your debug information.