Create macOS-specific settings

This commit is contained in:
Ivan Bushchik 2022-07-04 17:48:20 +03:00
parent 851ca70861
commit 5a972645cb
No known key found for this signature in database
GPG key ID: 3E4E9C7D66E44BF7
2 changed files with 30 additions and 1 deletions

View file

@ -32,8 +32,15 @@ sh $HOME/.dotfiles/tools/relink.sh
cd $CURRENTDIR
if [[ $(uname) = "Darwin"]]
then
sh tools/mac.sh
fi
echo "${GREEN}Dotfiles installed and linked.$DEFAULTC"
read -p "Would you like to configure git? (y/N): " answer
if [[ $answer = [Yy] ]]; then
sh tools/git.sh
fi
exec zsh

22
tools/mac.sh Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash
GREEN="\033[32m"
RED="\033[31m"
DEFAULTC="\033[0m"
# configuring mac-only things
# installing homebrew
echo "${GREEN}Installing Homebrew${DEFAULTC}"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [ "$(arch)" == "arm64" ]
then
HOMEBREW_PREFIX="/opt/homebrew"
else
HOMEBREW_PREFIX="/usr/local/homebrew"
fi
echo "eval \"\$($HOMEBREW_PREFIX/bin/brew shellenv)\"" >> $HOME/.zprofile
brew install pinentry-mac gpg2
echo "pinentry-program $HOMEBREW_PREFIX/bin/pinentry-mac" >> $HOME/.gnupg/gpg-agent.conf