dev-env/bin/script/setup
2024-08-04 21:31:58 +02:00

55 lines
911 B
Bash
Executable File

#!/bin/bash
echo $OSTYPE
#MAC
if [[ "$OSTYPE" == "darwin"* ]]; then
home="$HOME"
#LINUX
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
home="$HOME"
else
echo "Dieses Skript wird nicht unter macOS oder Linux unterstützt."
exit 1
fi
script_path=$(pwd)
environment=$(basename $script_path)
echo "source ~/$environment/bin/script/denv" >> ~/.profile
echo "source ~/$environment/bin/script/drun" >> ~/.profile
echo "source ~/$environment/bin/script/git" >> ~/.profile
echo Running in $script_path
echo environment = $environment
# $1 = frontend/backend
# $2 = repo name
fetch_repository() {
if [ ! -d "$1" ];
then
echo "Create $1"
mkdir -p "$1"
fi
cd $1
if [ ! -d "$2" ];
then
gh repo clone TheFlawww/$2-$1 $2
fi
cd $script_path
}
#fetch all backends
fetch_repository backend weedkeeper
#fetch all frontends
fetch_repository frontend weedkeeper
# initialize
./bin/script/init