chcp 65001>nul
@echo off & color 0A
@title git tool

rem 当前文件夹名称
pushd %1 & for %%i in (.) do set curr=%%~ni
if "%curr%"=="WingCloudServer" (
	cd ..
	goto Main
) else (
	echo the current folder is %curr%, operation was cancelled!
	pause>nul
	exit
)

:Main
echo [正在检查获取远程项目文件,请勿关闭当前操作页]	
for /d %%i in (*) do (
	cd %%i			
	if exist *.git (
		echo ---------------------- %%i ----------------------
		chdir && git pull
	)
	cd ..
)
echo;

if not exist WingAIDiagnosisService (git clone http://git.ius.plus/Project-Wing/WingAIDiagnosisService.git && echo;)
if not exist WingCloudServer (git clone http://git.ius.plus:88/Project-Wing/WingCloudServer.git && echo;)
if not exist WingDeviceService (git clone http://git.ius.plus:88/Project-Wing/WingDeviceService.git && echo;)
if not exist WingEmailModule (git clone http://git.ius.plus:88/Project-Wing/WingEmailModule.git && echo;)
if not exist WingInterfaceLibrary (git clone http://git.ius.plus:88/Project-Wing/WingInterfaceLibrary.git && echo;)
if not exist WingManagementModule (git clone http://git.ius.plus:88/Project-Wing/WingManagementModule.git && echo;)
if not exist WingMongoDBModule (git clone http://git.ius.plus:88/Project-Wing/WingMongoDBModule.git && echo;)
if not exist WingNotificationModule (git clone http://git.ius.plus/Project-Wing/WingNotificationModule.git && echo;)
if not exist WingRemedicalModule (git clone http://git.ius.plus:88/Project-Wing/WingRemedicalModule.git && echo;)
if not exist WingReportService (git clone http://git.ius.plus/Project-Wing/WingReportService.git && echo;)
if not exist WingServerCommon (git clone http://git.ius.plus:88/Project-Wing/WingServerCommon.git && echo;)
if not exist WingSessionModule (git clone http://git.ius.plus:88/Project-Wing/WingSessionModule.git && echo;)
if not exist WingSMSModule (git clone http://git.ius.plus:88/Project-Wing/WingSMSModule.git && echo;)
if not exist WingStorageModule (git clone http://git.ius.plus:88/Project-Wing/WingStorageModule.git && echo;)
if not exist WingUserModule (git clone http://git.ius.plus:88/Project-Wing/WingUserModule.git && echo;)
if not exist WingVinnoImageData (git clone http://git.ius.plus/Project-Wing/WingVinnoImageData.git && echo;)
if not exist WingLiveConsultationService (git clone http://git.ius.plus/Project-Wing/WingLiveConsultationService.git && echo;)
if not exist WingRtmpService (git clone http://git.ius.plus/Project-Wing/WingRtmpService.git && echo;)
if not exist WingRtcService (git clone http://git.ius.plus/Project-Wing/WingRtcService.git && echo;)
if not exist WingASRService (git clone http://git.ius.plus/Project-Wing/WingASRService.git && echo;)
if not exist WingEducationService (git clone http://git.ius.plus/Project-Wing/WingEducationService.git && echo;)
if not exist WingEducationService (git clone http://git.ius.plus/Project-Wing/WingEducationService.git && echo;)
if not exist WingPaymentService (git clone http://git.ius.plus/warr.qian/WingPaymentService.git && echo;) 
echo Finished!
pause>nul
exit