aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFivePixels <dylan.bolger00@gmail.com>2023-01-28 18:25:40 -0600
committertest <dylan.bolger00@gmail.com>2023-01-28 18:28:38 -0600
commit0937b3e9b138210b0f0cd76f0b28f45e030aa648 (patch)
treeea5c8e868833e8d840be6861e529277f9675d9b0
parentd278772e6318bcc5a8c16126df433194dc3a577c (diff)
downloaddots-0937b3e9b138210b0f0cd76f0b28f45e030aa648.tar.xz
dots-0937b3e9b138210b0f0cd76f0b28f45e030aa648.zip
Set env vars only if they exist, default .env
-rw-r--r--.config/fish/functions/envsource.fish8
-rw-r--r--.env6
2 files changed, 12 insertions, 2 deletions
diff --git a/.config/fish/functions/envsource.fish b/.config/fish/functions/envsource.fish
index dbcce39..aa0ae24 100644
--- a/.config/fish/functions/envsource.fish
+++ b/.config/fish/functions/envsource.fish
@@ -1,7 +1,11 @@
function envsource
for line in (cat $argv | grep -v '^#' | grep -v '^\s*$')
set item (string split -m 1 '=' $line)
- set -gx $item[1] (string trim --chars=\'\" $item[2])
- echo $item[1]
+ set key $item[1]
+ set value (string trim --chars=\'\" $item[2])
+ if test (string length $value) -ne 0
+ set -gx $key $value
+ echo $key
+ end
end
end
diff --git a/.env b/.env
new file mode 100644
index 0000000..4477366
--- /dev/null
+++ b/.env
@@ -0,0 +1,6 @@
+GIT_USER_NAME=
+GIT_USER_EMAIL=
+GIT_USER_SIGNINGKEY=
+GIT_CREDENTIAL_HELPER=
+GIT_GPG_PROGRAM=
+GIT_COMMIT_GPGSIGN=