reorganise installation script

This commit is contained in:
2016-06-19 15:24:11 +01:00
parent 6a99745ff8
commit 5c2ececbdf
7 changed files with 48 additions and 43 deletions

View File

@@ -5,29 +5,17 @@ echo "Installing dotfiles"
echo "Initializing submodule(s)"
git submodule update --init --recursive
source install/link.sh
if apropos "package manager" | grep -q apt; then
echo -e "\n\nUsing APT package manager"
if [ "$(uname)" == "Darwin" ]; then
echo -e "\n\nRunning on OSX"
source install/brew.sh
source install/osx.sh
source install/nvm.sh
# create a backup of the original nginx.conf
mv /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/nginx.original
ln -s ~/.dotfiles/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf
# symlink the code.dev from dotfiles
ln -s ~/.dotfiles/nginx/code.dev /usr/local/etc/nginx/sites-enabled/code.dev
source install/apt.sh
fi
echo "creating vim directories"
mkdir -p ~/.vim-tmp
source install/terminfo.sh
source install/ruby.sh
source install/link.sh
echo "Configuring zsh as default shell"
chsh -s $(which zsh)
# echo "Configuring zsh as default shell"
# chsh -s $(which zsh)
echo "Done."

15
install/apt.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
echo -e "\n\nInstalling APT packages..."
echo "=============================="
# cli tools
apt-get install tree
apt-get install wget
apt-get install curl
# development tools
apt-get install git
apt-get install tmux
apt-get install zsh
apt-get install ruby

View File

@@ -1,12 +1,11 @@
#!/usr/bin/env bash
set -e
# Backup files that are provided by the dotfiles into a ~/dotfiles-backup directory
DOTFILES=$HOME/.dotfiles
BACKUP_DIR=$HOME/dotfiles-backup
set -e # TODO: what does this do?
echo "Creating backup directory at $BACKUP_DIR"
mkdir -p $BACKUP_DIR
@@ -21,7 +20,7 @@ for file in $linkables; do
fi
done
typeset -a files=($HOME/.config/nvim $HOME/.vim $HOME/.vimrc)
typeset -a files=($HOME/.vim $HOME/.vimrc)
for file in $files; do
if [ -e $file ]; then
cp -rf $file $BACKUP_DIR

View File

@@ -32,19 +32,11 @@ for config in $DOTFILES/config/*; do
fi
done
# create vim symlinks
# As I have moved off of vim as my full time editor in favor of neovim,
# I feel it doesn't make sense to leave my vimrc intact in the dotfiles repo
# as it is not really being actively maintained. However, I would still
# like to configure vim, so lets symlink ~/.vimrc and ~/.vim over to their
# neovim equivalent.
echo -e "\n\nCreating vim symlinks"
echo "=============================="
typeset -A vimfiles
vimfiles[~/.vim]=$DOTFILES/config/nvim
vimfiles[~/.vimrc]=$DOTFILES/config/nvim/init.vim
vimfiles[~/.vim]=$DOTFILES/config/vim
vimfiles[~/.vimrc]=$DOTFILES/config/vim/init.vim
for file in "${!vimfiles[@]}"; do
if [ -e ${file} ]; then
@@ -54,3 +46,14 @@ for file in "${!vimfiles[@]}"; do
ln -s ${vimfiles[$file]} $file
fi
done
echo -e "\n\nCreating tmux symlinks"
echo "=============================="
file=~/.tmux/
if [ -e ${file}/plugins ]; then
echo "${file}/plugins already exists... skipping"
else
mkdir -p ~/.tmux/
echo "Creating symlink for $file/plugins"
ln -s $DOTFILES/tmux/plugins $file
fi

View File

@@ -1,10 +0,0 @@
#!/bin/sh
echo -e "\n\nInstalling Node (from nvm)"
echo "=============================="
# reload nvm into this environment
source $(brew --prefix nvm)/nvm.sh
nvm install stable
nvm alias default stable

7
install/ruby.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
DOTFILES=$HOME/.dotfiles
echo -e "\nRuby gems"
echo "=============================="
gem install tmuxinator

3
install/terminfo.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
tic resources/xterm-256color-italic.terminfo
tic resources/tmux-256color-italic.terminfo