clone&pull tool.bat 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. @echo off & color 0A
  2. @title git tool
  3. rem 当前文件夹名称
  4. pushd %1 & for %%i in (.) do set curr=%%~ni
  5. if "%curr%"=="WingCloudServer" (
  6. cd ..
  7. goto Main
  8. ) else (
  9. echo the current folder is %curr%, operation was cancelled!
  10. pause>nul
  11. exit
  12. )
  13. :Main
  14. set /a pullnum=0
  15. for /d %%i in (*) do (
  16. cd %%i
  17. if exist *.git (
  18. set /a pullnum+=1
  19. )
  20. cd ..
  21. )
  22. if %pullnum% equ 0 (
  23. echo [正在下载项目文件,请勿关闭当前操作页]
  24. goto Clone
  25. ) else (
  26. echo [正在检查获取远程代码,请勿关闭当前操作页]
  27. for /d %%i in (*) do (
  28. cd %%i
  29. if exist *.git (
  30. echo ---------------------- %%i ----------------------
  31. chdir && git pull
  32. )
  33. cd ..
  34. )
  35. if %pullnum% lss 15 (
  36. goto MsgClone
  37. )
  38. )
  39. echo;
  40. echo Finished!
  41. pause>nul
  42. exit
  43. :MsgClone
  44. echo;
  45. echo 远程代码已成功合并到本地,是否检查下载其它模块?(y/n)
  46. set /p dl=
  47. if "%dl%"=="y" (
  48. goto Clone
  49. ) else (
  50. echo;
  51. echo Finished!
  52. )
  53. pause>nul
  54. exit
  55. :Clone
  56. if not exist WingServerCommon (git clone http://git.ius.plus:88/Project-Wing/WingServerCommon.git && echo;)
  57. if not exist WingMongoDBModule (git clone http://git.ius.plus:88/Project-Wing/WingMongoDBModule.git && echo;)
  58. if not exist WingStorageModule (git clone http://git.ius.plus:88/Project-Wing/WingStorageModule.git && echo;)
  59. if not exist WingSMSModule (git clone http://git.ius.plus:88/Project-Wing/WingSMSModule.git && echo;)
  60. if not exist WingUserModule (git clone http://git.ius.plus:88/Project-Wing/WingUserModule.git && echo;)
  61. if not exist WingSessionModule (git clone http://git.ius.plus:88/Project-Wing/WingSessionModule.git && echo;)
  62. if not exist WingRemedicalModule (git clone http://git.ius.plus:88/Project-Wing/WingRemedicalModule.git && echo;)
  63. if not exist WingManagementModule (git clone http://git.ius.plus:88/Project-Wing/WingManagementModule.git && echo;)
  64. if not exist WingEmailModule (git clone http://git.ius.plus:88/Project-Wing/WingEmailModule.git && echo;)
  65. if not exist WingInterfaceLibrary (git clone http://git.ius.plus:88/Project-Wing/WingInterfaceLibrary.git && echo;)
  66. if not exist WingCloudServer (git clone http://git.ius.plus:88/Project-Wing/WingCloudServer.git && echo;)
  67. if not exist WingDeviceService (git clone http://git.ius.plus:88/Project-Wing/WingDeviceService.git && echo;)
  68. if not exist WingNotificationModule (git clone http://git.ius.plus/Project-Wing/WingNotificationModule.git && echo;)
  69. if not exist WingVinnoImageData (git clone http://git.ius.plus/fly.wang/WingVinnoImageData.git && echo;)
  70. if not exist WingReportService (git clone http://git.ius.plus/jeremy.zhang/WingReportService.git && echo;)
  71. echo Finished!
  72. pause>nul
  73. exit