From 5c2ececbdf91ac5b55f6e645dd06a016af5e6703 Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Sun, 19 Jun 2016 15:24:11 +0100 Subject: [PATCH] reorganise installation script --- install.sh | 28 ++++++++-------------------- install/apt.sh | 15 +++++++++++++++ install/backup.sh | 5 ++--- install/link.sh | 23 +++++++++++++---------- install/nvm.sh | 10 ---------- install/ruby.sh | 7 +++++++ install/terminfo.sh | 3 +++ 7 files changed, 48 insertions(+), 43 deletions(-) create mode 100644 install/apt.sh delete mode 100755 install/nvm.sh create mode 100755 install/ruby.sh create mode 100755 install/terminfo.sh diff --git a/install.sh b/install.sh index c468df9..0b5b26f 100755 --- a/install.sh +++ b/install.sh @@ -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." diff --git a/install/apt.sh b/install/apt.sh new file mode 100644 index 0000000..4f77c4c --- /dev/null +++ b/install/apt.sh @@ -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 \ No newline at end of file diff --git a/install/backup.sh b/install/backup.sh index 632a1ca..4280b35 100755 --- a/install/backup.sh +++ b/install/backup.sh @@ -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 diff --git a/install/link.sh b/install/link.sh index 25a1961..fda4f3b 100755 --- a/install/link.sh +++ b/install/link.sh @@ -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 diff --git a/install/nvm.sh b/install/nvm.sh deleted file mode 100755 index 3d249cd..0000000 --- a/install/nvm.sh +++ /dev/null @@ -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 diff --git a/install/ruby.sh b/install/ruby.sh new file mode 100755 index 0000000..b3cfd03 --- /dev/null +++ b/install/ruby.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +DOTFILES=$HOME/.dotfiles + +echo -e "\nRuby gems" +echo "==============================" +gem install tmuxinator \ No newline at end of file diff --git a/install/terminfo.sh b/install/terminfo.sh new file mode 100755 index 0000000..2e74494 --- /dev/null +++ b/install/terminfo.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +tic resources/xterm-256color-italic.terminfo +tic resources/tmux-256color-italic.terminfo \ No newline at end of file