rcaloras/bashhub-client

Filter by active dir

Ouverte

#59 ouverte le 24 déc. 2017

 (1 commentaire) (1 réaction) (0 personne assignée)Python (79 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (1 147 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur