Small sh "framework" to test some server responses
sh
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

12345678910111213141516171819202122232425262728
  1. #Copyright (C) 2016,2023 Weber Yann
  2. #
  3. #This program is free software; you can redistribute it and/or modify
  4. #it under the terms of the GNU General Public License as published by
  5. #the Free Software Foundation; either version 3 of the License, or
  6. #any later version.
  7. #
  8. #This program is distributed in the hope that it will be useful,
  9. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. #GNU General Public License for more details.
  12. #
  13. #You should have received a copy of the GNU General Public License
  14. #along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. check_git_repo() {
  16. tmpdir=$(mktemp -d -t check_git.XXXXXXXXX)
  17. git clone "$1" "$tmpdir" 2>/dev/null 1>/dev/null
  18. res="$?"
  19. rm -Rf "$tmpdir"
  20. if [ "$res" -ne 0 ]
  21. then
  22. fail "unable to clone git repo '$1'"
  23. else
  24. success "git repo '$1' cloned'"
  25. fi
  26. }