Improve osx setup
This commit is contained in:
parent
a4769f1909
commit
16c091ed53
8
curlrc
Normal file
8
curlrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
user-agent = "Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0"
|
||||||
|
referer = ";auto"
|
||||||
|
connect-timeout = 10
|
||||||
|
progress-bar
|
||||||
|
max-time = 90
|
||||||
|
show-error
|
||||||
|
remote-time
|
||||||
|
ipv4
|
112
install.sh
112
install.sh
|
@ -29,30 +29,104 @@ if [[ $platform != 'Linux' && $platform != 'Darwin' ]]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$HOME/.dotfiles" ]; then
|
setup_dotfile_repo() {
|
||||||
printf "${YELLOW}Creating dotfiles symlink${NORMAL}\n"
|
if [ ! -d "$HOME/.dotfiles" ]; then
|
||||||
ln -s $cwd $HOME/.dotfiles
|
printf "${YELLOW}Creating dotfiles symlink${NORMAL}\n"
|
||||||
fi
|
ln -s $cwd $HOME/.dotfiles
|
||||||
|
|
||||||
printf "Installing zsh..."
|
|
||||||
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
|
|
||||||
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
|
|
||||||
if hash chsh >/dev/null 2>&1; then
|
|
||||||
printf "\n${BLUE}Changing the default shell to zsh${NORMAL}\n"
|
|
||||||
chsh -s $(grep /zsh$ /etc/shells | tail -1)
|
|
||||||
else
|
|
||||||
printf "\n${RED}Unable to change the shell because this system does not have chsh.\n"
|
|
||||||
printf "${BLUE}If this is Windows then you probably want to run the bash installer.${NORMAL}\n"
|
|
||||||
fi
|
fi
|
||||||
else
|
}
|
||||||
printf "${YELLOW}already installed!${NORMAL}\n"
|
|
||||||
fi
|
link_file() {
|
||||||
|
file=$1
|
||||||
|
dest="$HOME/.$file"
|
||||||
|
if [ ! -e $dest ]; then
|
||||||
|
printf "${YELLOW}Creating ${file} symlink${NORMAL}\n"
|
||||||
|
ln -s "$HOME/.dotfiles/$file" $dest
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_git() {
|
||||||
|
printf "Setting up git...\n"
|
||||||
|
|
||||||
|
FILES=()
|
||||||
|
FILES+=('gitconfig')
|
||||||
|
FILES+=('githelpers')
|
||||||
|
|
||||||
|
for file in "${FILES[@]}"
|
||||||
|
do
|
||||||
|
link_file "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_zsh() {
|
||||||
|
printf "Setting up zsh...\n"
|
||||||
|
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
|
||||||
|
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
|
||||||
|
if hash chsh >/dev/null 2>&1; then
|
||||||
|
printf "\n${BLUE}Changing the default shell to zsh${NORMAL}\n"
|
||||||
|
chsh -s $(grep /zsh$ /etc/shells | tail -1)
|
||||||
|
else
|
||||||
|
printf "\n${RED}Unable to change the shell because this system does not have chsh.\n"
|
||||||
|
printf "${BLUE}If this is Windows then you probably want to run the bash installer.${NORMAL}\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILES=()
|
||||||
|
FILES+=('zsh')
|
||||||
|
FILES+=('zshrc')
|
||||||
|
FILES+=('zshenv')
|
||||||
|
FILES+=('zlogin')
|
||||||
|
FILES+=('zprofile')
|
||||||
|
|
||||||
|
for file in "${FILES[@]}"
|
||||||
|
do
|
||||||
|
link_file "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_vim() {
|
||||||
|
printf "Setting up vim...\n"
|
||||||
|
|
||||||
|
FILES=()
|
||||||
|
FILES+=('vim')
|
||||||
|
FILES+=('vimrc')
|
||||||
|
|
||||||
|
for file in "${FILES[@]}"
|
||||||
|
do
|
||||||
|
link_file "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_misc() {
|
||||||
|
printf "Setting up misc...\n"
|
||||||
|
|
||||||
|
FILES=()
|
||||||
|
FILES+=('curlrc')
|
||||||
|
FILES+=('racketrc')
|
||||||
|
|
||||||
|
for file in "${FILES[@]}"
|
||||||
|
do
|
||||||
|
link_file "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# ////////////////////////////////////////////////////////////////////////////////////////
|
# ////////////////////////////////////////////////////////////////////////////////////////
|
||||||
# OSX
|
# OSX
|
||||||
|
|
||||||
|
setup_osx() {
|
||||||
|
./osx/install.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
# ////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
# Run
|
||||||
|
|
||||||
|
setup_dotfile_repo
|
||||||
|
setup_git
|
||||||
|
setup_zsh
|
||||||
|
setup_vim
|
||||||
|
setup_misc
|
||||||
|
|
||||||
if [[ $platform == 'Darwin' ]]; then
|
if [[ $platform == 'Darwin' ]]; then
|
||||||
printf "\n${BOLD}Running the OS X installer${NORMAL}\n"
|
printf "\n${BOLD}Running the OS X installer${NORMAL}\n"
|
||||||
./osx/install.sh
|
setup_osx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
if which tput >/dev/null 2>&1; then
|
if which tput >/dev/null 2>&1; then
|
||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors)
|
||||||
|
@ -27,26 +27,21 @@ ln -sf $HOME/.dotfiles/osx/env.platform $HOME/.env.platform
|
||||||
printf "Installing git customizations...\n"
|
printf "Installing git customizations...\n"
|
||||||
ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform
|
ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform
|
||||||
|
|
||||||
printf "Installing Homebrew..."
|
|
||||||
if [ ! -d "/usr/local/Homebrew" ]; then
|
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
||||||
else
|
|
||||||
printf "${YELLOW}already installed!${NORMAL}\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
brew tap homebrew/core
|
brew tap homebrew/core
|
||||||
|
|
||||||
printf "Installing xquartz..."
|
printf "Installing xquartz..."
|
||||||
brew cask install xquartz
|
#brew cask install xquartz
|
||||||
|
|
||||||
brew_packages=(
|
brew_packages=(
|
||||||
'tree'
|
'tree'
|
||||||
'openssl'
|
'openssl'
|
||||||
'xclip'
|
# 'xclip'
|
||||||
'rlwrap'
|
'rlwrap'
|
||||||
'cmake'
|
'cmake'
|
||||||
'pkg-config'
|
'pkg-config'
|
||||||
'rust'
|
'vim'
|
||||||
|
# 'rust'
|
||||||
|
# 'go'
|
||||||
'sdl')
|
'sdl')
|
||||||
|
|
||||||
for package in "${brew_packages[@]}"
|
for package in "${brew_packages[@]}"
|
||||||
|
|
5
zshenv
5
zshenv
|
@ -10,6 +10,11 @@ export TERM=xterm-256color
|
||||||
# Use vim as the editor
|
# Use vim as the editor
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
|
|
||||||
|
# Homebrew setup
|
||||||
|
export HOMEBREW_NO_ANALYTICS=1
|
||||||
|
export HOMEBREW_NO_INSECURE_REDIRECT=1
|
||||||
|
export HOMEBREW_CASK_OPTS=--require-sha
|
||||||
|
|
||||||
# Grep tweaks
|
# Grep tweaks
|
||||||
export GREP_OPTIONS="-nRi --color --exclude-dir=.git --exclude-dir=tmp --exclude-dir=log --exclude-dir=node_modules --exclude-dir=bower_components --exclude-dir=coverage --exclude-dir=.bundle --exclude=*.csv --exclude=*.pdf --exclude-dir=vendor --exclude-dir=rdoc --exclude-dir=target --exclude-dir=personal --exclude-dir=resources/public/js/*.*" # --exclude-dir=images --exclude-dir=coverage
|
export GREP_OPTIONS="-nRi --color --exclude-dir=.git --exclude-dir=tmp --exclude-dir=log --exclude-dir=node_modules --exclude-dir=bower_components --exclude-dir=coverage --exclude-dir=.bundle --exclude=*.csv --exclude=*.pdf --exclude-dir=vendor --exclude-dir=rdoc --exclude-dir=target --exclude-dir=personal --exclude-dir=resources/public/js/*.*" # --exclude-dir=images --exclude-dir=coverage
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user