From 1b0b142c26125ebe30b290117f37896488c9a331 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Wed, 6 Mar 2024 21:29:54 -0800 Subject: [PATCH] updated the setup.sh script with OS checks --- setup.sh | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 841ed4c..0807c7d 100755 --- a/setup.sh +++ b/setup.sh @@ -4,11 +4,41 @@ #Filename: setup.sh 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 () { echo "does nothing right now" } + install_needed_dependencies () { # Check the OS echo "checking the OS..." @@ -19,12 +49,15 @@ install_needed_dependencies () { # If it's windows....you're SOL } + create_project_symlinks () { # Allows the clangd LSP to find it. ln -s ./build/compile_commands.json ./compile_commands.json } + build_cpputest () { + git submodule add https://github.com/cpputest/cpputest.git touch build cd ./build make @@ -39,4 +72,10 @@ default () { create_project_symlinks } -default +setup() { + echo "Setting up env" + check_os + install_dev_utils +} + +setup