-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bat script to update all repositories
- Loading branch information
1 parent
8cde419
commit 72b44db
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
for /d %%i in (%cd%\*) do (CALL :do_dir %%i %~1 || EXIT /B) | ||
ECHO SUCCESS! | ||
EXIT /B | ||
|
||
:do_dir | ||
cd %~1 | ||
git fetch | ||
if %ERRORLEVEL% EQU 0 ( | ||
(CALL :do_git %~2 || EXIT /B 1) | ||
) | ||
cd .. | ||
EXIT /B | ||
|
||
:do_git | ||
(git checkout master && call :do_default master %~1) || (git checkout main && CALL :do_default main %~1) || EXIT /B 1 | ||
EXIT /B | ||
|
||
:do_default | ||
(git merge origin/%~1) || (EXIT /B 1) | ||
(git checkout %~2) || (EXIT /B 0) | ||
(git merge %~1 || EXIT /B 1) | ||
git merge origin/%~2 | ||
EXIT /B 0 |