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