From 472a7cd6d641a36a08cb360380355e31734b397d Mon Sep 17 00:00:00 2001 From: Shital Shah Date: Wed, 7 Nov 2018 18:23:40 -0800 Subject: [PATCH] Commit all environment repos script --- tools/gitcommitall.bat | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/gitcommitall.bat b/tools/gitcommitall.bat index 873532e3a..3ed588d07 100644 --- a/tools/gitcommitall.bat +++ b/tools/gitcommitall.bat @@ -1,13 +1,19 @@ -REM @echo off +@echo off REM //---------- set up variable ---------- setlocal set ROOT_DIR=%~dp0 REM root folder for repos set RepoRoot=%1 +set CommitMessage=%2 + +IF "%CommitMessage%"=="" ( + echo "CommitMessage needs to be provided" + goto :failed +) IF NOT EXIST %RepoRoot% ( - echo "Specify root directory for repo as argument!" + echo "RepoRoot needs to be provided" goto :failed ) @@ -33,12 +39,11 @@ TrapCamera Warehouse ZhangJiaJie ) do ( -echo Now doing "%%x" -cd %RepoRoot% -cd +@echo Now doing "%%x" +cd /d %RepoRoot% cd "%%x" git add -A -git commit -m "By gitcomitall.bat" +git commit -m %CommitMessage% git push cd .. ) @@ -47,8 +52,8 @@ cd .. goto :done :failed -echo "Error occured while packaging" -echo "Usage: package.bat " +@echo "Error occured" +@echo Usage: gitcommitall cd "%ROOT_DIR%" exit /b 1