From 1bde6601031345bebdf54009dbac3885a13387c9 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Wed, 6 Mar 2024 00:43:53 -0800 Subject: [PATCH] added a setup script for installing zig and some other needed utilities. --- scripts/setup.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 scripts/setup.sh diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..3140a5f --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Author: Jake G +# Date: 2024 +# Filename: setup.sh +# Description: Installs all the needed dependencies for this project. + +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 +} + + +install_zig () { + if [ $DEBIAN -eq 1 ]; then + sudo apt install zig + elif [ $FBSD -eq 1 ]; then + sudo pkg install zig + fi +} + + +check_os () { + if [ -f /etc/debian_version ]; then + DEBIAN=1 + elif [ -f /etc/freebsd-update.conf ]; then + FBSD=1 + fi +} + + +setup () { + echo "Setting up env" + check_os + install_dev_utils + install_zig +} + +setup