install 837 B

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