cdc
cdc copied to clipboard
Add handling of multiple repos with same name in different locations
Assuming the following:
CDC_DIRS=(dir1 dir2)
cdc repo
and the following directories both exist
dir1/repo
dir2/repo
We need to ask the user which one to cd to. Currently, it will just cd to the first instance it finds.
We should gather existing directories in an array, and if the array's size is > 1, prompt the user. Consider using the select command.
After some thought, I would hate to be prompted every time. This is what I think should happen:
- The first time a duplicate is found, ask the user which to prefer. Cache the result.
- Going forward, the cached result will take precedence.
- The user can pass a flag to re-prompt and re-cache.
- Debug mode will display a warning every time a cached directory is used. This way, the user will know why it always goes to an unexpected directory.
- :boom:
I say :boom: like it's an easy fix, but it'll be a fundamental change and will be a medium-difficulty effort.