- @echo off
-
- set ubk=Update.bk.cmd
-
- if not "%1"=="run" (
- copy /y "%~0" %ubk%
- %ubk% run
- del /f /q %ubk%
- )
-
- set maps_dir=sas.maps
- set maps_url="http://parasite.kicks-ass.org:3000/sasgis/maps.git"
-
- git version
-
- echo Return code: %ERRORLEVEL%
-
- if ERRORLEVEL 9009 (
- echo Žè¨¡ª : �¥ ãáâ ®¢«¥ Git
- start "" "https://git-scm.com/downloads"
- goto end
- )
-
- if not exist ".git\" (
- goto CloneRepo
- ) else (
- goto UpdateRepo
- )
-
- :CloneRepo
- echo „¥« ¥¬ ª«® ९®§¨â®à¨ï á á¥à¢¥à
- rd /s /q %maps_dir%
- git clone %maps_url% %maps_dir%
- if not ERRORLEVEL 0 (
- echo Žè¨¡ª á¢ï§¨ á á¥à¢¥à®¬
- goto end
- )
-
- echo Š®¯¨à㥬 ¯ ¯ªã á ९®§¨â®à¨¥¬ ¨§ ¯®¤¯ ¯ª¨ ¢ ⥪ãéãî ¯ ¯ªã
- xcopy /i /s /h /e /y %maps_dir%\.git .\.git
- if not ERRORLEVEL 0 (
- echo Žè¨¡ª ª®¯¨à®¢ ¨ï ¯ ¯ª¨ .git
- goto end
- )
-
- echo “¤ «ï¥¬ ¢à¥¬¥® ᮧ¤ ãî ¯®¤¯ ¯ªã
- rd /s /q %maps_dir%
- if not ERRORLEVEL 0 (
- echo Žè¨¡ª 㤠«¥¨ï ¢à¥¬¥®© ¯ ¯ª¨ sas.maps
- goto end
- )
- goto UpdateRepo
-
- :UpdateRepo
- echo Ž¡®¢«ï¥¬ ä ©«ë ¤® ¯®á«¥¤¥© ¢¥àᨨ
- git fetch --all --verbose
- git clean -d -x --force --exclude="%ubk%"
- git reset --hard origin/master
- goto end
-
- :end
- pause
|