Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. GIT_ROOT=$(git rev-parse --show-toplevel)
  4. # only include stuff in src and include
  5. SRC_PATTERNS="{include,src}/**/*.{hpp,cpp,tpp,h,c}"
  6.  
  7. # @brief Get list of files in git index with names relative to root
  8. # @param $1 Any of the constraints git-ls-files knows (e.g. --cached)
  9. function git_sources()
  10. {
  11. FILE_STRING=$(git -C $GIT_ROOT ls-files --full-name $1 $SRC_PATTERNS)
  12. echo "$FILE_STRING"
  13. }
  14.  
  15. git -C $GIT_ROOT ls-files --full-name --cached {include,src}/**/*.{hpp,cpp,tpp,h,c}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement