12345678910111213141516171819202122232425262728293031 |
- #! /bin/bash
- # Link everthing in '$PWD' to a dir in '~/$PWD'
- #
- # Put a COPY (not link) of his in any directory that should have it's
- # file linked into root.
- # Any files listed (one per line) in .install.ignore will be ignored
- # get the directory of this script
- WHERE_AM_I="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
- cd ${WHERE_AM_I}
- # Extract the directory name of this file
- BASEDIR=`basename $WHERE_AM_I`
- # find link2home.sh script
- if [ -e ${HOME}/bin/link2home.sh ]; then
- LINK2HOME="${HOME}/bin/link2home.sh"
- elif [ -e ${WHERE_AM_I}/link2home.sh ]; then
- LINK2HOME="${WHERE_AM_I}/link2home.sh"
- else
- echo "Can't find link2home.sh"
- exit 1
- fi
- echo Linking evertying in "${WHERE_AM_I}" into "~/""${BASEDIR}"
- ${LINK2HOME} -v -d -r --tobase
- # any directory specific post-processing (permissions, etc) goes here.
|