-
Notifications
You must be signed in to change notification settings - Fork 2
/
Update.cmd
55 lines (41 loc) · 1.16 KB
/
Update.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@echo off
set maps_dir=sas.maps
set maps_url="https://github.com/sasgis/sas.maps"
git fetch --verbose %maps_url%
echo %ERRORLEVEL%
if ERRORLEVEL 9009 goto NoGit
if ERRORLEVEL 128 goto CloneRepo
if ERRORLEVEL 0 goto UpdateRepo
if ERRORLEVEL -1 goto CloneRepo
goto err
:CloneRepo
echo „¥« ¥¬ ª«® ९®§¨â®à¨ï á á¥à¢¥à
rd /s /q %maps_dir%
git clone %maps_url% %maps_dir%
if not ERRORLEVEL 0 goto err
echo Š®¯¨à㥬 ¯ ¯ªã á ९®§¨â®à¨¥¬ ¨§ ¯®¤¯ ¯ª¨ ¢ ⥪ãéãî ¯ ¯ªã
xcopy /i /s /h /e /y %maps_dir%\.git .\.git
if not ERRORLEVEL 0 goto ErrorCopyGit
echo “¤ «ï¥¬ ¢à¥¬¥® ᮧ¤ ãî ¯®¤¯ ¯ªã
rd /s /q %maps_dir%
if not ERRORLEVEL 0 goto ErrorRemoveTemp
goto UpdateRepo
:UpdateRepo
echo Ž¡®¢«ï¥¬ ä ©«ë ¤® ¯®á«¥¤¥© ¢¥àᨨ
git clean -d --force
git reset --hard
goto end
:err
echo Žè¨¡ª á¢ï§¨ á á¥à¢¥à®¬
goto end
:ErrorCopyGit
echo Žè¨¡ª ª®¯¨à®¢ ¨ï ¯ ¯ª¨ .git
goto end
:ErrorRemoveTemp
echo Žè¨¡ª 㤠«¥¨ï ¢à¥¬¥®© ¯ ¯ª¨ sas.maps
goto end
:NoGit
echo Žè¨¡ª : ¥ ãáâ ®¢«¥ Git
goto end
:end
pause