Call git secret hide whenever //secrets.json is saved

Having `git secret hide` as a pre-commit hook doesn't make much sense to me. I
will detail why when/if I write a blog post on briefcase's secret mgt setup.

The problem is, if I change secrets.json and then run `git status`, I won't see
any pending changes. This is because secrets.json is gitignore'd. If I run `git
secret hide` everytime I save secrets.json, I can rest assured that my `git
status` will be consistent with any updates to secrets.json.
This commit is contained in:
William Carroll 2020-08-20 18:41:39 +01:00
parent 17c68d654b
commit 5b6862ea39

View file

@ -180,6 +180,12 @@
;; trim whitespace on save
(add-hook 'before-save-hook #'delete-trailing-whitespace)
;; call `git secret hide` after saving ~/briefcase/secrets.json
(add-hook 'after-save-hook
(lambda ()
(when (f-equal? (buffer-file-name) "~/briefcase/secrets.json")
(shell-command "git secret hide"))))
;; use tabs instead of spaces
(setq-default indent-tabs-mode nil)