My dotfiles for my Linux rice managed with stow and make
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sync.sh 615B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. repo="/home/micah/git/dotfiles/"
  3. files="./files"
  4. while read file
  5. do
  6. if [[ $file != "" && $file != \#* ]]; then
  7. filepath=`dirname $file|cut -d'/' -f2-`
  8. filename=`basename "$file"`
  9. if eval "test -e $file"; then
  10. if [[ $filepath != "~" ]]; then
  11. filepath=$filepath/
  12. mkdir -p $repo$filepath
  13. else
  14. filepath=""
  15. fi
  16. if eval "test -f $file"; then
  17. eval "rsync --links $file $repo$filepath$filename"
  18. elif eval "test -d $file"; then
  19. eval "rsync --links -r $file/ $repo$filepath$filename --delete"
  20. fi
  21. fi
  22. fi
  23. done < $files