Fix bugs and add checks for Xcode CLI and Homebrew
This commit is contained in:
parent
7039236d53
commit
f64b5b7229
31
setup.sh
31
setup.sh
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/zsh
|
||||||
|
|
||||||
echo "Configuring macOS System Settings (you may be asked to enter password)"
|
echo "Configuring macOS System Settings (you may be asked to enter password)"
|
||||||
|
|
||||||
@ -57,18 +57,31 @@ echo "- Avoid creating .DS_Store files on external volumes"
|
|||||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||||
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
|
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
|
||||||
|
|
||||||
# Install Homebrew
|
# Check if Xcode CLI Tools are installed, install them if not
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
if [[ $(xcode-select -p) == "" ]]; then
|
||||||
|
xcode-select --install
|
||||||
|
else
|
||||||
|
echo "Xcode CLI Tools are already installed"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set git to save any credentials in the macOS Keychain
|
# Set git to save any credentials in the macOS Keychain
|
||||||
git config --global credential.helper osxkeychain
|
git config --global credential.helper osxkeychain
|
||||||
|
|
||||||
|
# Check if Homebrew is present, update if installed, run the install script if not
|
||||||
|
if [[ $(command -v brew) == "" ]]; then
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
else
|
||||||
|
echo "Homebrew is already installed, running brew update"
|
||||||
|
brew update
|
||||||
|
fi
|
||||||
|
|
||||||
# Run Homebrew bundle with specified file
|
# Run Homebrew bundle with specified file
|
||||||
brew bundle --file Brewfile
|
brew bundle --file Brewfile
|
||||||
# Run bash script to reconfigure Dock
|
# Run bash script to reconfigure Dock
|
||||||
./Dock.sh
|
./Dock.sh
|
||||||
|
|
||||||
# Applescript to open up Terminal using the downloaded theme
|
# Function to open up Terminal using the downloaded theme
|
||||||
|
setCustomTerminalTheme(){
|
||||||
cp Custom.terminal ~/Downloads/Custom.terminal
|
cp Custom.terminal ~/Downloads/Custom.terminal
|
||||||
osascript <<EOD
|
osascript <<EOD
|
||||||
tell application "Terminal"
|
tell application "Terminal"
|
||||||
@ -78,10 +91,18 @@ tell application "Terminal"
|
|||||||
delay 1
|
delay 1
|
||||||
end tell
|
end tell
|
||||||
EOD
|
EOD
|
||||||
# Set theme to default
|
|
||||||
defaults write com.apple.Terminal "Startup Window Settings" -string "Custom"
|
defaults write com.apple.Terminal "Startup Window Settings" -string "Custom"
|
||||||
defaults write com.apple.Terminal "Default Window Settings" -string "Custom"
|
defaults write com.apple.Terminal "Default Window Settings" -string "Custom"
|
||||||
rm ~/Downloads/Custom.terminal
|
rm ~/Downloads/Custom.terminal
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if custom Terminal theme is already set and set up if not
|
||||||
|
if [[ $(defaults read com.apple.Terminal "Startup Window Settings") !== "Custom" ]]; then
|
||||||
|
setCustomTerminalTheme
|
||||||
|
echo "Custom Terminal theme is now the default"
|
||||||
|
else
|
||||||
|
echo "Custom Terminal theme is already set as default"
|
||||||
|
fi
|
||||||
|
|
||||||
#Copy ZSH Profile
|
#Copy ZSH Profile
|
||||||
rsync zshrc ~/.zshrc
|
rsync zshrc ~/.zshrc
|
||||||
|
Loading…
Reference in New Issue
Block a user