updated the setup.sh script with OS checks
This commit is contained in:
parent
7272bc6f71
commit
1b0b142c26
41
setup.sh
41
setup.sh
|
@ -4,11 +4,41 @@
|
||||||
#Filename: setup.sh
|
#Filename: setup.sh
|
||||||
|
|
||||||
PKG_MNGR=""
|
PKG_MNGR=""
|
||||||
|
DEBIAN=0
|
||||||
|
FBSD=0
|
||||||
|
|
||||||
|
DEV_UTILS="vim tmux fzf"
|
||||||
|
|
||||||
|
|
||||||
|
install_dev_utils () {
|
||||||
|
ICMD=""
|
||||||
|
if [ $DEBIAN -eq 1 ]; then
|
||||||
|
ICMD="sudo apt install"
|
||||||
|
elif [ $FBSD -eq 1 ]; then
|
||||||
|
ICMD="sudo pkg install"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for util in $DEV_UTILS
|
||||||
|
do
|
||||||
|
${ICMD} ${util}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
check_os () {
|
||||||
|
if [ -f /etc/debian_version ]; then
|
||||||
|
DEBIAN=1
|
||||||
|
elif [ -f /etc/freebsd-update.conf ]; then
|
||||||
|
FBSD=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
remove_template_examples () {
|
remove_template_examples () {
|
||||||
echo "does nothing right now"
|
echo "does nothing right now"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install_needed_dependencies () {
|
install_needed_dependencies () {
|
||||||
# Check the OS
|
# Check the OS
|
||||||
echo "checking the OS..."
|
echo "checking the OS..."
|
||||||
|
@ -19,12 +49,15 @@ install_needed_dependencies () {
|
||||||
# If it's windows....you're SOL
|
# If it's windows....you're SOL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
create_project_symlinks () {
|
create_project_symlinks () {
|
||||||
# Allows the clangd LSP to find it.
|
# Allows the clangd LSP to find it.
|
||||||
ln -s ./build/compile_commands.json ./compile_commands.json
|
ln -s ./build/compile_commands.json ./compile_commands.json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
build_cpputest () {
|
build_cpputest () {
|
||||||
|
git submodule add https://github.com/cpputest/cpputest.git
|
||||||
touch build
|
touch build
|
||||||
cd ./build
|
cd ./build
|
||||||
make
|
make
|
||||||
|
@ -39,4 +72,10 @@ default () {
|
||||||
create_project_symlinks
|
create_project_symlinks
|
||||||
}
|
}
|
||||||
|
|
||||||
default
|
setup() {
|
||||||
|
echo "Setting up env"
|
||||||
|
check_os
|
||||||
|
install_dev_utils
|
||||||
|
}
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
Loading…
Reference in New Issue