ondir

Automatically execute scripts when entering/leaving directories

brewmacoslinux
Try with needOr install directly
Source

About

Automatically execute scripts as you traverse directories

Commands

ondir

Examples

Set up a script to run when entering a specific directory$ ondir /path/to/directory 'echo Welcome to this directory'
Create an .ondir file in a directory to auto-execute on entry$ echo 'source venv/bin/activate' > /path/to/project/.ondir && cd /path/to/project
Set up exit script to run when leaving a directory$ ondir -x /path/to/directory 'deactivate'