rcaloras/bashhub-client

Filter by active dir

开放

#59 创建于 2017年12月24日

 (1 条评论) (1 个反应) (0 位负责人)Python (79 个派生)batch import
enhancementgood first issue

仓库指标

星标
 (1,147 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南