aboutsummaryrefslogtreecommitdiff
path: root/.config/fish/functions/envsource.fish
diff options
context:
space:
mode:
Diffstat (limited to '.config/fish/functions/envsource.fish')
-rw-r--r--.config/fish/functions/envsource.fish8
1 files changed, 6 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