mirror of
https://github.com/zoriya/flake.git
synced 2026-05-28 08:57:56 +00:00
Better dotenv func
This commit is contained in:
@@ -130,12 +130,10 @@ dotenv() {
|
||||
shift
|
||||
fi
|
||||
|
||||
ENV=$(cat $DOTENV | sed '/^#/d' | tr '\n' ' ')
|
||||
|
||||
if [[ -z $* ]]; then
|
||||
export ${=ENV}
|
||||
set -a && source $DOTENV && set +a
|
||||
else
|
||||
(export ${=ENV}; $*)
|
||||
(set -a && source $DOTENV && set +a && $*)
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user