Skip to content

Commit

Permalink
fix: load env bash
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jan 15, 2024
1 parent 33b4e3b commit 98e37b6
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions export-env.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#!/bin/sh

## Usage:
## . ./export-env.sh ; $COMMAND
## . ./export-env.sh ; echo ${MINIENTREGA_FECHALIMITE}

unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then

export $(grep -v '^#' .env | xargs -d '\n')

elif [ "$unamestr" = 'FreeBSD' ] || [ "$unamestr" = 'Darwin' ]; then

export $(grep -v '^#' .env | xargs -0)

if [ -f .env ]; then
# Load environment variables from .env file
source .env
echo "Environment variables loaded from .env file."
else
echo ".env file not found."
exit 1
fi

0 comments on commit 98e37b6

Please sign in to comment.