downloadTestAssets.sh 532 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Copyright (C) Mike JS. Choi, 2018
  3. # Copyright (C) 2018 VLC authors and VideoLAN
  4. set -e
  5. error()
  6. {
  7. local red="\033[31m"
  8. local normal="\033[0m"
  9. echo "${red}error:${normal} $1"
  10. }
  11. ASSET_DIR="Assets"
  12. cd "$(dirname "$0")"
  13. if [ -e ${ASSET_DIR} ]; then
  14. cd ${ASSET_DIR}
  15. git reset --hard
  16. git pull origin master
  17. else
  18. git clone https://code.videolan.org/videolan/TestAssets.git ${ASSET_DIR}
  19. if [ $? -ne 0 ]; then
  20. error "Please remove all files in vlckit/Tests/${ASSET_DIR} and try again"
  21. exit 1
  22. fi
  23. fi