rcaloras/bashhub-client

Filter by active dir

Aperta

#59 aperta il 24 dic 2017

 (1 commento) (1 reazione) (0 assegnatari)Python (79 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (1147 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Filtering by command is great, but how about also filtering by currently active directory? I've quickly hammered something into place that works using preexec...

# Added to end of  ~/.bashrc

__peri_filter_preexec() { if [[ "${PWD}" =~ .*Private.* ]] ; then __BH_SAVE_COMMAND=''; fi }
if [ -f ~/.bashhub/deps/bash-preexec.sh ]; then source  ~/.bashhub/deps/bash-preexec.sh ; preexec_functions+=(__peri_filter_preexec); fi

Prevents saving any command while active in any path containing the word Private But this feels a bit iffy, would prefer not to have to use internal bashhub variables, etc, etc

Guida contributor