about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-05T23·26+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-02-05T23·26+0000
commit138070f3f6492cdd45acf17ae4e1d25e30de7653 (patch)
treeed40485a6846fed2aff290603e8c480472f9ca44
parent1772408c3989c86044ee97ca9bd51ddf509adb47 (diff)
Inherit parent's .envrc variables
I discovered direnv's convenient `source_up` function today. I needed it to
inherit the values defined in ~/briefcase/.envrc, and it's working exactly as I
expected it would. What a fine piece of software direnv is.
-rw-r--r--monzo-ynab/.envrc2
-rw-r--r--monzo_ynab/.envrc5
2 files changed, 5 insertions, 2 deletions
diff --git a/monzo-ynab/.envrc b/monzo-ynab/.envrc
deleted file mode 100644
index 6a45e34bd0a2..000000000000
--- a/monzo-ynab/.envrc
+++ /dev/null
@@ -1,2 +0,0 @@
-export client_id="$(pass show finance/monzo/client-id)"
-export client_secret="$(pass show finance/monzo/client-secret)"
diff --git a/monzo_ynab/.envrc b/monzo_ynab/.envrc
new file mode 100644
index 000000000000..265077343800
--- /dev/null
+++ b/monzo_ynab/.envrc
@@ -0,0 +1,5 @@
+# source_up traversing up directories until it finds the nearest .envrc file,
+# which it uses to extend the environment in this .envrc.
+source_up
+export client_id="$(pass show finance/monzo/client-id)"
+export client_secret="$(pass show finance/monzo/client-secret)"