-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitglue.bat
44 lines (39 loc) · 872 Bytes
/
gitglue.bat
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
@echo off
rem /***********************************************************************
rem * gitglue Script by [email protected]
rem * - To glue together your git Repositories
rem *
rem * To execute commands inside all git repositories found
rem * within the current directory, recursivly.
rem *
rem * Example:
rem * E:\Speed4Trade_V3\Server\gitglue.bat git pull
rem *
rem * !!! Attention !!!
rem * WITH GREAT POWER COMES GREAT RESPONSIBILITY!
rem *
rem **********************************************************************/
SET INITIAL_DIR=%cd%
@setlocal enableextensions enabledelayedexpansion
set str1=%1
if exist .git (
if not x%str1:&=%==x%str1% (
%~1
) else (
%*
)
goto eof
)
for /f %%i in ('dir /ad /s /b .git') do (
echo.
cd /d %%i\..
cd
if not x%str1:&=%==x%str1% (
%~1
) else (
%*
)
)
endlocal
:eof
cd /d %INITIAL_DIR%