You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 line
1.2 KiB

  1. @echo off
  2. set maps_dir=sas.maps
  3. set maps_url="https://github.com/sasgis/sas.maps"
  4. git status
  5. echo %ERRORLEVEL%
  6. if ERRORLEVEL 9009 goto NoGit
  7. if ERRORLEVEL 128 goto CloneRepo
  8. if ERRORLEVEL 0 goto UpdateRepo
  9. if ERRORLEVEL -1 goto CloneRepo
  10. goto err
  11. :CloneRepo
  12. echo „¥« ¥¬ ª«®­ ९®§¨â®à¨ï á á¥à¢¥à 
  13. rd /s /q %maps_dir%
  14. git clone %maps_url% %maps_dir%
  15. if not ERRORLEVEL 0 goto err
  16. echo Š®¯¨à㥬 ¯ ¯ªã á ९®§¨â®à¨¥¬ ¨§ ¯®¤¯ ¯ª¨ ¢ ⥪ãéãî ¯ ¯ªã
  17. xcopy /i /s /h /e /y %maps_dir%\.git .\.git
  18. if not ERRORLEVEL 0 goto ErrorCopyGit
  19. echo “¤ «ï¥¬ ¢à¥¬¥­­® ᮧ¤ ­­ãî ¯®¤¯ ¯ªã
  20. rd /s /q %maps_dir%
  21. if not ERRORLEVEL 0 goto ErrorRemoveTemp
  22. goto UpdateRepo
  23. :UpdateRepo
  24. echo Ž¡­®¢«ï¥¬ ä ©«ë ¤® ¯®á«¥¤­¥© ¢¥àᨨ
  25. git fetch --all --verbose
  26. git clean -d -x --force
  27. git reset --hard origin/master
  28. goto end
  29. :err
  30. echo Žè¨¡ª  á¢ï§¨ á á¥à¢¥à®¬
  31. goto end
  32. :ErrorCopyGit
  33. echo Žè¨¡ª  ª®¯¨à®¢ ­¨ï ¯ ¯ª¨ .git
  34. goto end
  35. :ErrorRemoveTemp
  36. echo Žè¨¡ª  㤠«¥­¨ï ¢à¥¬¥­­®© ¯ ¯ª¨ sas.maps
  37. goto end
  38. :NoGit
  39. echo Žè¨¡ª : �¥ ãáâ ­®¢«¥­ Git
  40. goto end
  41. :end
  42. pause