diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-25T13·19+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-25T13·19+0100 |
commit | 8eed16dc671f49e8ffcf51557b06a65720bd40d7 (patch) | |
tree | bb41112bc520b89b25b4965cf75a4530281b7456 /emacs/.emacs.d/wpc/wpc-misc.el | |
parent | 21ce27b0ca948ddab2206baf36707d00822e5206 (diff) |
Replace calls to (getenv "BRIEFCASE") with constants/briefcase
I would prefer to define constants/briefcase in terms of `(getenv "BRIEFCASE")` and assert that `(f-exists? (getenv "BRIEFCASE"))`, in one location: constants.el
Diffstat (limited to 'emacs/.emacs.d/wpc/wpc-misc.el')
-rw-r--r-- | emacs/.emacs.d/wpc/wpc-misc.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/emacs/.emacs.d/wpc/wpc-misc.el b/emacs/.emacs.d/wpc/wpc-misc.el index 5b21ec410892..897f0e56eb12 100644 --- a/emacs/.emacs.d/wpc/wpc-misc.el +++ b/emacs/.emacs.d/wpc/wpc-misc.el @@ -13,6 +13,7 @@ (require 'project) (require 'f) (require 'dash) +(require 'constants) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Configuration @@ -180,10 +181,11 @@ ;; trim whitespace on save (add-hook 'before-save-hook #'delete-trailing-whitespace) -;; call `git secret hide` after saving ~/briefcase/secrets.json +;; call `git secret hide` after saving secrets.json (add-hook 'after-save-hook (lambda () - (when (f-equal? (buffer-file-name) "~/briefcase/secrets.json") + (when (f-equal? (buffer-file-name) + (f-join constants/briefcase "secrets.json")) (shell-command "git secret hide")))) ;; use tabs instead of spaces @@ -207,7 +209,7 @@ (defun project-find-function--briefcase (dir) "Find the nearest default.nix file; otherwise, terminate at the .git directory." - (when (s-starts-with? (getenv "BRIEFCASE") (f-expand dir)) + (when (s-starts-with? constants/briefcase (f-expand dir)) (if (f-exists? (f-join dir "default.nix")) (cons 'transient dir) (project-find-function--briefcase (f-parent dir))))) |