andsens / homeshick

git dotfiles synchronizer written in bash
MIT License
2.11k stars 145 forks source link

Add optional directory argument to `cd` command #214

Closed overhacked closed 1 year ago

overhacked commented 1 year ago

Adds the ability to specify an optional second argument to the homeshick cd command that will change directory into the castle repo's subdirectory that corresponds to the given directory, as long as it is within $HOME and is tracked by the castle.

Most convenient to use when $PWD is within $HOME:

homeshick cd CASTLE .

Other changes

andsens commented 1 year ago

OK, so this is in part on me for not documenting the feature better, but you can already do this: image

The $PWD feature is neat, but without some strong usecases I don't see the justification for the additional code. It's just not something I imagine one would use very often.

All of that being said. Beautiful PR! With tests and everything :-)

Perhaps you could make a new PR to extend the helptext to include the homeshick cd CASTLE[/DIR] usage?