infctl-cli/scripts/envrc_checks.sh

23 lines
536 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# check if an .envrc file exists
if [ ! -f .envrc ]; then
echo ".envrc file not found"
cp .envrc.example .envrc
if [ $? -eq 0 ]; then
echo ".envrc file created from .envrc.example"
else
echo "Failed to create .envrc file"
exit 1
fi
else
echo ".envrc file found"
cp .envrc vagrant/dev/ubuntu/.envrc
if [ $? -eq 0 ]; then
echo ".envrc file synced to vagrant/dev/ubuntu/.envrc"
else
echo "Failed to sync .envrc file"
exit 1
fi
fi