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.

38 lines
1.1 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #!/bin/bash
  2. git add .
  3. printf "Enter commit message: "
  4. read message
  5. git commit -m "$message" --dry-run
  6. read -p "Are you sure you want to commit these changes? [yn]: " -n 1 -r
  7. if [[ $REPLY =~ ^[Yy]$ ]]
  8. then
  9. printf "\nCommitting changes...\n"
  10. node ./scripts/import-emoji-paths.js
  11. git add .
  12. git commit -m "$message"
  13. read -p "Push changes? [yn]: " -n 1 -r
  14. if [[ $REPLY =~ ^[Yy]$ ]]
  15. then
  16. printf "\nTo where?\n"
  17. read -p 'Remote: ' remote
  18. read -p 'Branch: ' branch
  19. printf "Pushing changes...\n"
  20. git push -u $remote $branch
  21. elif [[ $REPLY =~ ^[Nn]$ ]]
  22. then
  23. printf "\nNot pushing committed changes, exiting..."
  24. [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
  25. else
  26. printf "\nUnexpected argument, not pushing committed changes, exiting..."
  27. [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
  28. fi
  29. elif [[ $REPLY =~ ^[Nn]$ ]]
  30. then
  31. printf "\nExiting..."
  32. git reset
  33. [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
  34. else
  35. printf "\nUnexpected argument, exiting..."
  36. git reset
  37. [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
  38. fi