Cleanup Code,
add missing directory changes
This commit is contained in:
parent
836a1532cc
commit
777dea9073
@ -12,5 +12,5 @@ for d in */; do
|
||||
cd ..
|
||||
done
|
||||
|
||||
cd
|
||||
cd installation
|
||||
./build.sh
|
56
install.sh
56
install.sh
@ -1,58 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
debian=false;
|
||||
arch=false;
|
||||
mac=false;
|
||||
|
||||
# get operating system
|
||||
os_info() {
|
||||
install_packages() {
|
||||
declare -A osInfo;
|
||||
osInfo[/etc/arch-release]=arch
|
||||
osInfo[/etc/debian_version]=debian
|
||||
osInfo[/usr/local/Homebrew]=mac
|
||||
osInfo[/usr/bin/pacman]=pacman
|
||||
osInfo[/usr/bin/apt]=apt
|
||||
osInfo[/usr/local/Homebrew]=brew
|
||||
|
||||
for f in ${!osInfo[@]}
|
||||
do
|
||||
if [[ -f $f ]];then
|
||||
if [[ ${osInfo[$f]} == 'arch' ]]; then
|
||||
arch=true;
|
||||
elif [[ ${osInfo[$f]} == 'debian' ]]; then
|
||||
debian=true;
|
||||
elif [[ ${osInfo[$f]} == 'mac' ]]; then
|
||||
mac=true;
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
if [[ ${osInfo[$f]} == 'pacman' ]]; then
|
||||
pacman -S clang make cmake fltk catch2
|
||||
|
||||
# installing package, $1 = pacman; $2 = apt-get, $3 = homebrew
|
||||
install() {
|
||||
if [ $debian == true ] && [ $2 != 'null' ]; then
|
||||
sudo apt-get install $2
|
||||
elif [ $arch == true ] && [ $1 != 'null' ]; then
|
||||
sudo pacman -S $1
|
||||
elif [ $mac == true ] && [ $3 != 'null' ]; then
|
||||
sudo brew install $3
|
||||
fi
|
||||
}
|
||||
|
||||
os_info
|
||||
|
||||
install 'clang' 'clang' 'clang'
|
||||
install 'make' 'make' 'make'
|
||||
install 'cmake' 'cmake' 'cmake'
|
||||
install 'null' 'clang-tidy' 'clang-tidy'
|
||||
install 'fltk' 'libfltk1.3 libfltk1.3-dev' 'fltk'
|
||||
install 'catch2' 'null' 'catch2'
|
||||
|
||||
if [[ $apt ]]; then
|
||||
elif [[ ${osInfo[$f]} == 'apt' ]]; then
|
||||
apt install clang make cmake clang-tidy libfltk1.3 libfltk1.3-dev
|
||||
|
||||
git clone https://github.com/catchorg/Catch2.git
|
||||
cd Catch2
|
||||
cmake -Bbuild -H. -DBUILD_TESTING=OFF
|
||||
sudo cmake --build build/ --target install
|
||||
|
||||
elif [[ ${osInfo[$f]} == 'brew' ]]; then
|
||||
brew install llvm clang make cmake clang-format fltk catch2
|
||||
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
install_packages
|
||||
|
||||
echo "cloning repositories"
|
||||
cd ..
|
||||
|
Loading…
Reference in New Issue
Block a user