X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=install-symlinks.sh;h=17e0f0a42b7259df3e1140cf2b42513b87ce50f5;hb=8d95075cb0c3da9dfcefcd612f9fc081b16ea08b;hp=3588ed2e344e1110a991418bbeff214acdbc2477;hpb=a52fadc70df8054a6017d899f53a635f4fcdb82f;p=cmccabe-etc diff --git a/install-symlinks.sh b/install-symlinks.sh index 3588ed2..17e0f0a 100755 --- a/install-symlinks.sh +++ b/install-symlinks.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # install-symlinks.sh @@ -15,8 +15,7 @@ die() { exit 1 } -FULLPATH=`readlink -f $0` -BASEDIR=`dirname ${FULLPATH}` +BASEDIR=`pwd` for file in ${BASEDIR}/.[^.]*; do # get base file name, like ".gitconfig" basefile=`basename ${file}` @@ -25,15 +24,14 @@ for file in ${BASEDIR}/.[^.]*; do relfile=`echo ${file} | sed 's_.*/\([^/]*/[^/]*\)$_\1_'` # skip files which we don't want to link - if [ "${basefile}" == ".git" ]; then - continue; - fi + [ "${basefile}" == ".git" ] && continue + [ "${basefile}" == ".gitignore" ] && continue pushd .. > /dev/null if [ -L ${basefile} ]; then # Someone already created this link. Pass over it in silence : - elif [ -z ${basefile} ]; then + elif [ ! -a ${basefile} ]; then # Create the link ln -s ${relfile} || die "failed to link ${relfile}" echo "created ${relfile}..."