mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
19 lines
261 B
Bash
19 lines
261 B
Bash
|
#!/bin/bash
|
||
|
# use source script/env.sh
|
||
|
|
||
|
args=("$@")
|
||
|
|
||
|
if [[ $# -eq 1 ]]; then
|
||
|
args+=(.env)
|
||
|
fi
|
||
|
|
||
|
for FILE in "$@"
|
||
|
do
|
||
|
echo "Loading env vars from: $FILE"
|
||
|
ARGS=$(cat $FILE |grep -vE '^[[:space:]]*(#.*)*$')
|
||
|
|
||
|
export $(echo $ARGS|xargs)
|
||
|
echo "$ARGS\n"
|
||
|
done
|
||
|
|