{"action":"created","issue":{"url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/59","repository_url":"https://api.github.com/repos/rcaloras/bashhub-client","labels_url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/59/comments","events_url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/59/events","html_url":"https://github.com/rcaloras/bashhub-client/issues/59","id":284366478,"number":59,"title":"Filter by active dir","user":{"login":"Perilin","id":2394282,"avatar_url":"https://avatars0.githubusercontent.com/u/2394282?v=4","gravatar_id":"","url":"https://api.github.com/users/Perilin","html_url":"https://github.com/Perilin","followers_url":"https://api.github.com/users/Perilin/followers","following_url":"https://api.github.com/users/Perilin/following{/other_user}","gists_url":"https://api.github.com/users/Perilin/gists{/gist_id}","starred_url":"https://api.github.com/users/Perilin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perilin/subscriptions","organizations_url":"https://api.github.com/users/Perilin/orgs","repos_url":"https://api.github.com/users/Perilin/repos","events_url":"https://api.github.com/users/Perilin/events{/privacy}","received_events_url":"https://api.github.com/users/Perilin/received_events","type":"User","site_admin":false},"labels":[{"id":56572476,"url":"https://api.github.com/repos/rcaloras/bashhub-client/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":767995699,"url":"https://api.github.com/repos/rcaloras/bashhub-client/labels/good%20first%20issue","name":"good first issue","color":"3dc5f7","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-24T14:42:52Z","updated_at":"2017-12-24T20:00:30Z","closed_at":null,"author_association":"NONE","body":"Filtering by command is great, but how about also filtering by currently active directory?\r\nI've quickly hammered something into place that works using preexec...\r\n\r\n```bash\r\n# Added to end of  ~/.bashrc\r\n\r\n__peri_filter_preexec() { if [[ \"${PWD}\" =~ .*Private.* ]] ; then __BH_SAVE_COMMAND=''; fi }\r\nif [ -f ~/.bashhub/deps/bash-preexec.sh ]; then source  ~/.bashhub/deps/bash-preexec.sh ; preexec_functions+=(__peri_filter_preexec); fi\r\n```\r\n\r\nPrevents saving any command while active in any path containing the word _Private_\r\nBut this feels a bit _iffy_, would prefer not to have to use internal bashhub variables, etc, etc\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/comments/353800937","html_url":"https://github.com/rcaloras/bashhub-client/issues/59#issuecomment-353800937","issue_url":"https://api.github.com/repos/rcaloras/bashhub-client/issues/59","id":353800937,"user":{"login":"rcaloras","id":149818,"avatar_url":"https://avatars1.githubusercontent.com/u/149818?v=4","gravatar_id":"","url":"https://api.github.com/users/rcaloras","html_url":"https://github.com/rcaloras","followers_url":"https://api.github.com/users/rcaloras/followers","following_url":"https://api.github.com/users/rcaloras/following{/other_user}","gists_url":"https://api.github.com/users/rcaloras/gists{/gist_id}","starred_url":"https://api.github.com/users/rcaloras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcaloras/subscriptions","organizations_url":"https://api.github.com/users/rcaloras/orgs","repos_url":"https://api.github.com/users/rcaloras/repos","events_url":"https://api.github.com/users/rcaloras/events{/privacy}","received_events_url":"https://api.github.com/users/rcaloras/received_events","type":"User","site_admin":false},"created_at":"2017-12-24T20:00:30Z","updated_at":"2017-12-24T20:00:30Z","author_association":"OWNER","body":"@Perilin thanks for the feedback and example using preexec!\r\n\r\nThis would actually be a pretty straight forward change. I think this could be implemented via the config (i.e. `~/.bashhub/config`) as a regex similar to the existing command filter. You could also check or edit it via the bashhub filter command.\r\n\r\nAny interest in submitting a PR? You could template from how I built the command filter in https://github.com/rcaloras/bashhub-client/commit/a4a0c75ea04d160."}}
{"actor":{"display_login":"rcaloras"}}