No Description
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.

todogitsync 846B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. #save todo list to git - 07-10-2010
  3. ### create temp folder
  4. tmpfolder='tmptodo'
  5. if [ $# -ge 1 ]; then
  6. tmpfolder=$1
  7. fi
  8. if [ -d "$tmpfolder" ]; then #check if folder exists
  9. echo "Folder already exists. Exiting..."
  10. exit 0
  11. fi
  12. echo "Creating temporary folder $tmpfolder..."
  13. mkdir -p $tmpfolder
  14. cd $tmpfolder
  15. ### find calcurse folder
  16. folder='/home/jlc/.calcurse' #should be improved
  17. ### pull from github
  18. echo "Pulling files from github..."
  19. git init
  20. git remote add origin git@github.com:XX/todo.git
  21. git pull origin master
  22. ### copy apts and todo
  23. echo "Copying files..."
  24. cp $folder/{apts,todo} .
  25. ### push to github
  26. echo "Pushing changes..."
  27. git add apts
  28. git add todo
  29. git commit -m "Automatic commit"
  30. git push origin master
  31. ### undo tmp changes
  32. echo "Removing temporary folder..."
  33. cd - &>/dev/null
  34. rm -rf $tmpfolder