lots of exercises in java... from https://github.com/exercism/java

fetch-configlet 648B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. LATEST=https://github.com/exercism/configlet/releases/latest
  3. OS=$(
  4. case $(uname) in
  5. (Darwin*)
  6. echo "mac";;
  7. (Linux*)
  8. echo "linux";;
  9. (Windows*)
  10. echo "windows";;
  11. (*)
  12. echo "linux";;
  13. esac)
  14. ARCH=$(
  15. case $(uname -m) in
  16. (*64*)
  17. echo 64bit;;
  18. (*686*)
  19. echo 32bit;;
  20. (*386*)
  21. echo 32bit;;
  22. (*)
  23. echo 64bit;;
  24. esac)
  25. VERSION="$(curl --head --silent $LATEST | awk -v FS=/ '/Location:/{print $NF}' | tr -d '\r')"
  26. URL=https://github.com/exercism/configlet/releases/download/$VERSION/configlet-$OS-${ARCH}.tgz
  27. curl -s --location $URL | tar xz -C bin/