Skip to content

Commit

Permalink
scripts:bootstrap: only source .env file if it exists
Browse files Browse the repository at this point in the history
Also fix shellcheck warning when sourced files do not exist
  • Loading branch information
silopolis authored and JoAngel8 committed Dec 28, 2023
1 parent 76d7c70 commit a17f7ae
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@ set -e #ux
cwd="$(pwd)"
## Change to project directory
cd "$(dirname "$0")/.."
# shellcheck source="../.env"
source .env
if [ -f .env ]; then
# shellcheck source="../.env" disable=SC1091
source .env
fi

./scripts/python_setup.sh "$@"

echo "-- Shell: Source profile in case it's been updated"
# shellcheck source="$HOME/.profile"
# shellcheck source="$HOME/.profile" disable=SC1091
source "$HOME/.profile"

echo "-- Activate Python virtual environment"
# shellcheck source="../.venv/bin/activate"
source .venv/bin/activate
echo "-- Source '.env' configuration file"
# shellcheck source="../.env"
source .env

if [ -f .env ]; then
echo "-- Source '.env' configuration file"
# shellcheck source="../.env" disable=SC1091
source .env
fi

## and go back
cd "$cwd"

0 comments on commit a17f7ae

Please sign in to comment.