Guest User

Untitled

a guest
Jun 11th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #
  2. # zim_update - update the zim repository
  3. #
  4.  
  5. local current_head
  6. local diff
  7.  
  8. cd ${ZIM_HOME}
  9.  
  10. current_head=$(git rev-parse HEAD)
  11. # this is the cleanest way I know how to update a repository
  12. git remote update -p
  13. git merge --ff-only @\{u\}
  14. # and update the submodules
  15. git submodule update --init --recursive
  16.  
  17. #Only care if we actually updated
  18. if [ ${current_head} != $(git rev-parse HEAD) ]; then
  19. # Go to templates
  20. cd ${ZIM_HOME}/Templates
  21.  
  22. # Create diff var
  23. diff=$(git diff HEAD~1 HEAD ./*)
  24.  
  25. #Only show changes if templates have changed
  26. if [ ! -z ${diff} ]; then
  27. echo "Please review the following changes to Zim's default configuration:"
  28. echo ${diff}
  29. fi
  30. fi
Add Comment
Please, Sign In to add comment