dev-env/setup
2024-09-14 13:48:22 +00:00

34 lines
932 B
Bash
Executable File

#!/bin/bash
# THIS SCRIPT NEEDS TO BE EXECUTED FIRST AFTER CLONING THE ENVIRONMENT AND SHALL NEVER BE EXECUTED AGAIN
# IT SETS UP THE ENVIRONMENT IN THE PROFILE TO ENABLE CORE COMMANDS LIKE denv drun dexec
# MAC
if [[ "$OSTYPE" == "darwin"* ]]; then
home="$HOME"
# LINUX
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
home="$HOME"
else
echo "Dieses Skript wird auf deinem Gerät nicht unterstützt"
exit 1
fi
ENV_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
echo "Setup dev-env..."
echo "Adding sourcing of environment commands to .profile"
echo "" >> ~/.profile
echo "# denv commands setup" >> ~/.profile
echo "source $ENV_DIR/bin/denv" >> ~/.profile
echo "source $ENV_DIR/bin/drun" >> ~/.profile
echo "source $ENV_DIR/bin/dexec" >> ~/.profile
echo "source $ENV_DIR/bin/git" >> ~/.profile
echo "appending dev-env .profile to .profile"
echo "" >> ~/.profile
cat .profile >> ~/.profile