Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. set -e
  3.  
  4. files() {
  5. git diff --name-only --cached --full-index
  6. }
  7.  
  8. check() {
  9. while read file; do
  10. filename=$(basename "$file")
  11. extension="${filename##*.}"
  12. if [ "rb" = $extension ]; then
  13. if [ -f "$file" ]; then ruby -c $file >/dev/null; fi
  14. fi
  15. done
  16. }
  17.  
  18. echo "Checking ruby syntax..."
  19. files | check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement