changepkgs.sh 465 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. #set -x
  3. files=`.rider/changefiles.sh "*\.go$"`
  4. exitCode=$?
  5. if [[ ${exitCode} -ne 0 ]]; then
  6. echo ".rider/changefiles.sh fail"
  7. exit ${exitCode}
  8. fi
  9. pkgs=""
  10. for file in ${files}
  11. do
  12. pkg="${file%/*}"
  13. if [ $? -eq 0 ]; then
  14. if [[ "${pkgs}" = "" ]]; then
  15. pkgs="${pkg}"
  16. else
  17. pkgs="${pkgs}\n${pkg}"
  18. fi
  19. fi
  20. done
  21. echo -e "${pkgs}" > .rider/.pkgs
  22. pkgs=`sort .rider/.pkgs|uniq`
  23. echo -e "${pkgs}"