aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté <mikisabate@gmail.com>2013-07-31 13:44:44 +0200
committerMiquel Sabaté <mikisabate@gmail.com>2013-07-31 13:44:44 +0200
commitbeb7e96b45b8d32d87a3d128b4068ca4c3b36853 (patch)
tree8fbaae111837155223c6b056088136e4717b73ca
parent5e2b6d05c9fa3ae6ef9565fdd3ec268d0157cfc7 (diff)
downloaddotfiles-beb7e96b45b8d32d87a3d128b4068ca4c3b36853.tar.gz
dotfiles-beb7e96b45b8d32d87a3d128b4068ca4c3b36853.zip
Moved the install script from Ruby to plain bash
-rw-r--r--bashrc53
-rw-r--r--gitcompletion.sh (renamed from gitcompletion)0
-rw-r--r--install.rb29
-rwxr-xr-xinstall.sh17
4 files changed, 22 insertions, 77 deletions
diff --git a/bashrc b/bashrc
index 3fb9a79..4cf49b7 100644
--- a/bashrc
+++ b/bashrc
@@ -52,52 +52,9 @@ export GOROOT=$HOME/Projects/go
export GOPATH=$HOME/.go
export PATH=$HOME/.go/bin:$HOME/Projects/go/bin:$PATH
-# Including shortcuts, idea from https://github.com/fxn/dotfiles
-GO_SHORTCUTS=(
- ruby
- $KRUBY
+# Completion for the review command. See: https://github.com/mssola/review
+source $HOME/.review_completion.sh
- build
- $KDEV/build/kdev-ruby
-)
-
-function g {
- local target=$1
- local len=${#GO_SHORTCUTS[@]}
- for (( i=0; i<$len; i+=2 )); do
- if [[ "$1" = "${GO_SHORTCUTS[$i]}" ]]; then
- cd "${GO_SHORTCUTS[$i+1]}"
- return
- fi
- done
- echo "unknown shortcut"
-}
-
-# The path for patches.
-export PATCH=$HOME/.patches
-
-# Create a patch and save it to the directory of patches. If the patch
-# already exists, it will ask if the user wants to overwrite it.
-p() {
- path="$PATCH/$1.patch"
-
- # The patch file already exists.
- if [ -f $path ]; then
- echo "The patch \`$1' already exists."
- read -p "Do you want to overwrite its contents ? (Y/n) " yn
- case $yn in
- n | N | no | NO ) exit 1
- esac
- fi
-
- # Choose the proper SCM tool.
- if [ -d .git ]; then
- git diff > $path
- elif [ -d .hg ]; then
- hg diff > $path
- elif [ -d .svn ]; then
- svn diff > $path
- else
- echo 'Unsupported SCM.'
- fi
-}
+# The g utility. See: https://github.com/mssola/g
+source $HOME/.g.sh
+source $HOME/.gcompletion.sh
diff --git a/gitcompletion b/gitcompletion.sh
index 39a5314..39a5314 100644
--- a/gitcompletion
+++ b/gitcompletion.sh
diff --git a/install.rb b/install.rb
deleted file mode 100644
index af00537..0000000
--- a/install.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-##
-# Simple script to install all the files to our home
-#
-
-#!/usr/bin/env ruby
-
-# Check for the wirble gem since the .irbrc file requires
-# this gem to successfully work.
-begin
- require 'wirble'
-rescue LoadError
- puts 'The .irbrc file requires wirble and you haven\'t this gem installed!'
- exit
-end
-
-# You can change your home directory ;)
-home = ARGV[0]
-home ||= '$HOME'
-
-`cp bashrc #{home}/.bashrc`
-`cp irbrc #{home}/.irbrc`
-`cp gemrc #{home}/.gemrc`
-`cp gitcompletion #{home}/.gitcompletion.sh`
-`cp gitconfig #{home}/.gitconfig`
-`cp global.gitignore #{home}/.gitignore`
-`cp vimrc #{home}/.vimrc`
-`cp hgrc #{home}/.hgrc`
-`cp rake_completion #{home}/.rake_completion`
-`chmod +x #{home}/.rake_completion`
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..bda9717
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+
+# If something goes wrong, get the f*ck out.
+set -e
+
+# Install the files on this repo.
+cp bashrc $HOME/.bashrc
+cp irbrc $HOME/.irbrc
+cp gemrc $HOME/.gemrc
+cp gitcompletion.sh $HOME/.gitcompletion.sh
+cp gitconfig $HOME/.gitconfig
+cp global.gitignore $HOME/.gitignore
+cp vimrc $HOME/.vimrc
+cp hgrc $HOME/.hgrc
+cp rake_completion $HOME/.rake_completion
+chmod +x $HOME/.rake_completion