Skip to content

Commit ef8e310

Browse files
Support .env file for config and layout environment
1 parent 0ad341a commit ef8e310

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

get-config.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
# It now pulls in settings from _config.yml
77
# TODO: just read _config.yml once!
88

9+
# Load environment variables from .env (if present)
10+
# shellcheck disable=SC1091
11+
if [ -f .env ]; then
12+
set -a
13+
source .env
14+
set +a
15+
fi
16+
917
if [[ "$CONFIG" ]]; then
1018
echo "Warning: Using config from $CONFIG rather than _config.yml"
1119
_CONFIG_YML="$CONFIG"

make-layouts.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ shopt -s nullglob
88

99
echo Setting up layouts
1010

11+
# Load environment variables from .env (if present)
12+
# shellcheck disable=SC1091
13+
if [ -f .env ]; then
14+
set -a
15+
source .env
16+
set +a
17+
fi
18+
1119
if [[ -d .layouts ]]; then
1220
echo "Warning: .layouts exists so not cloning"
1321
else

0 commit comments

Comments
 (0)