Browse Source

update zmp

pull/1/head
sasbot 2 years ago
parent
commit
5cf93d3f9f
1 changed files with 34 additions and 28 deletions
  1. +34
    -28
      Update.cmd

+ 34
- 28
Update.cmd View File

@@ -1,56 +1,62 @@
@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="https://github.com/sasgis/sas.maps"
set maps_url="http://parasite.kicks-ass.org:3000/sasgis/maps.git"
git status
git version
echo %ERRORLEVEL%
echo Return code: %ERRORLEVEL%
if ERRORLEVEL 9009 goto NoGit
if ERRORLEVEL 128 goto CloneRepo
if ERRORLEVEL 0 goto UpdateRepo
if ERRORLEVEL -1 goto CloneRepo
if ERRORLEVEL 9009 (
echo Žè¨¡ª : �¥ ãáâ ­®¢«¥­ Git
start "" "https://git-scm.com/downloads"
goto end
)
goto err
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 goto err
if not ERRORLEVEL 0 (
echo Žè¨¡ª  á¢ï§¨ á á¥à¢¥à®¬
goto end
)
echo Š®¯¨à㥬 ¯ ¯ªã á ९®§¨â®à¨¥¬ ¨§ ¯®¤¯ ¯ª¨ ¢ ⥪ãéãî ¯ ¯ªã
xcopy /i /s /h /e /y %maps_dir%\.git .\.git
if not ERRORLEVEL 0 goto ErrorCopyGit
if not ERRORLEVEL 0 (
echo Žè¨¡ª  ª®¯¨à®¢ ­¨ï ¯ ¯ª¨ .git
goto end
)
echo “¤ «ï¥¬ ¢à¥¬¥­­® ᮧ¤ ­­ãî ¯®¤¯ ¯ªã
rd /s /q %maps_dir%
if not ERRORLEVEL 0 goto ErrorRemoveTemp
if not ERRORLEVEL 0 (
echo Žè¨¡ª  㤠«¥­¨ï ¢à¥¬¥­­®© ¯ ¯ª¨ sas.maps
goto end
)
goto UpdateRepo
:UpdateRepo
echo Ž¡­®¢«ï¥¬ ä ©«ë ¤® ¯®á«¥¤­¥© ¢¥àᨨ
git fetch --all --verbose
git clean -d -x --force
git clean -d -x --force --exclude="%ubk%"
git reset --hard origin/master
goto end
:err
echo Žè¨¡ª  á¢ï§¨ á á¥à¢¥à®¬
goto end
:ErrorCopyGit
echo Žè¨¡ª  ª®¯¨à®¢ ­¨ï ¯ ¯ª¨ .git
goto end
:ErrorRemoveTemp
echo Žè¨¡ª  㤠«¥­¨ï ¢à¥¬¥­­®© ¯ ¯ª¨ sas.maps
goto end
:NoGit
echo Žè¨¡ª : �¥ ãáâ ­®¢«¥­ Git
goto end
:end
pause

Loading…
Cancel
Save