Skip to content

Commit 3a94f50

Browse files
committed
enh: check if .env exists before exporting
1 parent 14a6bfe commit 3a94f50

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.envrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#! /bin/bash
22

3+
if [ ! -f .env ]; then
4+
echo "No .env file found"
5+
return
6+
fi
7+
38
# for each valid key under .env, export it
49
dotenv=.env
510
export $(cat $dotenv | grep -v '^#' | xargs)

0 commit comments

Comments
 (0)