README, but for local mess

· by Gürkan · Read in about 1 min · (213 Words)

When you go to a repository, first thing you look is a README. I realized this might be the case for some of the local folders (since I am currently re-organizing). So I've defined a simple concept to keep track what's happening on a foler.

The rules are simple, just create a dotfile (so it would be hidden) under any directory you feel like needs explanation: .folder-README. Afterwards add a simple check like following to your shell configuration (for me it is .zshrc, same logic can be applied to .bashrc or even /etc/profile if you want to implement this system-wide):

    if [ -e .folder-README ]; then
        # Do however you want to get notified
        # add it to your PROMPT/RPROMPT
        # add it to PROMPT_COMMAND
        # or simply cat .folder-README

Since I am familiar to have a prompt on the right side if extra information available (like git directories etc.), this simple condition is just checking if my current directory has a .folder-README and shows an "R" character for notifying me.

I also have a simple alias to readme to cat .folder-README:

I didn't see a similar idea on the web in my quick search so I wanted to mention it here. I hope you don't have messy folders like mine :)