Code cleanup and better MacOS support

This commit is contained in:
2024-01-18 18:39:20 +00:00
parent a8847b6421
commit f209ca084a
7 changed files with 62 additions and 26 deletions

36
macos.sh Normal file → Executable file
View File

@@ -1,12 +1,36 @@
#! /bin/bash
#! /bin/zsh
source ./scripts/p.sh
source ./scripts/color.sh
dist=$(d)
if [ $dist != 3 ]; then
echo -e "${RED}[E] Run linux.sh for Linux instead.${ENDCOLOR}"
return 1
fi
# Ask Y/n
function ask() {
read -p "$1 (Y/n): " resp
if [ -z "$resp" ]; then
response_lc="y" # empty is Yes
else
response_lc=$(echo "$resp" | tr '[:upper:]' '[:lower:]') # case insensitive
fi
[ "$response_lc" = "y" ]
}
# Copy configs
echo -e "${GREEN}[+] Configuring system...${ENDCOLOR}"
cp -rf homeConfigs/.* ~
# Install brew
echo -e "${GREEN}[+] Installing homebrew...${ENDCOLOR}"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add brew to path
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') > /Users/trude/.zprofile
# Enable brew
eval "$(/opt/homebrew/bin/brew shellenv)"
echo 'PATH="/usr/local/bin:$PATH"' > ~/.bash_profile
# Install VScode
brew install visual-studio-code
echo -e "${GREEN}${BOLD}[i] All done.${ENDCOLOR}"