Mercurial > repos > other > linux
comparison setup.sh @ 3:2a6d32a03c0e
Work around differing paths for hgview
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Jul 2013 20:19:21 +0100 |
parents | a5fc9c16087c |
children | 2c7cac745457 |
comparison
equal
deleted
inserted
replaced
2:a5fc9c16087c | 3:2a6d32a03c0e |
---|---|
1 #! /bin/bash | 1 #! /bin/bash |
2 | 2 |
3 SCRIPTPATH=`dirname $(readlink -f $0)` | 3 SCRIPTPATH=`dirname $(readlink -f $0)` |
4 create_symlink() { | 4 create_symlink() { |
5 SOURCEFILE=$1 | |
6 if [ "${SOURCEFILE:0:1}" != "/" ]; then | |
7 SOURCE_FILE=$SCRIPTPATH/$1 | |
8 fi | |
5 if [ ! -e $2 ]; then | 9 if [ ! -e $2 ]; then |
6 ln -s $SCRIPTPATH/$1 $2 | 10 ln -s $SOURCEFILE $2 |
7 elif [ "$(readlink $2)" != "$SCRIPTPATH/$1" ]; then | 11 elif [ "$(readlink $2)" != "$SCRIPTPATH/$1" ]; then |
8 echo "Unable to link $1 config - $2 already existed" >&2 | 12 echo "Unable to link $1 config - $2 already existed" >&2 |
9 fi | 13 fi |
10 #Else it already existed but was correct | 14 #Else it already existed but was correct |
11 } | 15 } |
12 | 16 |
13 create_symlink tmux.conf ~/.tmux.conf | 17 create_symlink tmux.conf ~/.tmux.conf |
14 create_symlink hgrc ~/.hgrc | 18 create_symlink hgrc ~/.hgrc |
15 create_symlink bashrc ~/.bashrc | 19 create_symlink bashrc ~/.bashrc |
20 create_symlink /usr/lib/python*/site-packages/hgext/hgview.py ~/.hgview.py |