You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm in a directory, and it's not currently on the stack, there's no way to add it unless you use cdc DIR. It'd be nice if you could do cdc . and have it push to the stack.
Example:
cd~/repo
cd a/nested/subdir
# Now I want to go back to the root of `repo`, but can't use `cdc -n`# SOLUTIONcd~/repo # oh crap, I want this on the history stack
cdc .
Also, and I'm not sure about this one... but it'd be cool to add cdc .., and it would traverse up the directory tree until it found a file in the CDC_REPO_MARKERS, changed to that directory, and added it to the stack (if requested).
The text was updated successfully, but these errors were encountered:
I've been thinking more about this. I'm thinking that cdc . can serve both purposes. If $CDC_REPOS_ONLY == true or -r, then it will traverse up $PWD until it finds a $CDC_REPO_MARKER. If none is found, do nothing and print an error. If $CDC_REPOS_ONLY == false or -R, add the current directory.
I've also debated checking to make sure that one of $CDC_DIRS is in your current path... but not sure about this one.
Was playing around but didn't create a branch yet. Sticking this here for now.
### If the argument is `.` and the current directory contains one of the# $CDC_DIRS, add the root of the directory to the stack.if [[ $cd_dir=='.' ]];then
should_return=true
fordirin${CDC_DIRS[@]};doif! [[ $PWD=~$dir ]];thencontinuefi
wdir=${PWD/$dir}echo$wdirif [[ -z$wdir ]];then# TODO: add real outputecho"you're in a cddir"breakfi
CDC_HISTORY+=("$wdir")
donefi
If I'm in a directory, and it's not currently on the stack, there's no way to add it unless you use
cdc DIR
. It'd be nice if you could docdc .
and have it push to the stack.Example:
Also, and I'm not sure about this one... but it'd be cool to add
cdc ..
, and it would traverse up the directory tree until it found a file in theCDC_REPO_MARKERS
, changed to that directory, and added it to the stack (if requested).The text was updated successfully, but these errors were encountered: