detect the repo/db from the dir name