Skip to content

Commit

Permalink
clean up git
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Mar 22, 2024
1 parent 0d1bf34 commit 9679c1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cm-mlops/script/get-git-repo/run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ if not exist "%CM_TMP_GIT_PATH%" (
deltree %folder%
)
echo ******************************************************
echo Current directory: %CUR_DIR%
echo.
echo Cloning %CM_GIT_REPO_NAME% from %CM_GIT_URL%
echo.
echo "%CM_GIT_CLONE_CMD%"
echo.
%CM_GIT_CLONE_CMD%
IF !ERRORLEVEL! NEQ 0 EXIT !ERRORLEVEL!
cd %folder%
Expand Down Expand Up @@ -51,6 +55,7 @@ if not "%CM_GIT_SUBMODULES%" == "" (

if "%CM_GIT_PATCH%" == "yes" (
for %%x in (%CM_GIT_PATCH_FILEPATHS%) do (
echo.
echo Applying patch %%x ...
git apply %%x
IF !ERRORLEVEL! NEQ 0 EXIT !ERRORLEVEL!
Expand Down
7 changes: 7 additions & 0 deletions cm-mlops/script/get-git-repo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ folder=${CM_GIT_CHECKOUT_FOLDER}
if [ ! -d "${CM_TMP_GIT_PATH}" ]; then
rm -rf ${folder}
echo "******************************************************"
echo "Current directory: ${CUR_DIR}"
echo ""
echo "Cloning ${CM_GIT_REPO_NAME} from ${CM_GIT_URL}"
echo ""
echo "${CM_GIT_CLONE_CMD}";
echo ""

${CM_GIT_CLONE_CMD}
if [ "${?}" != "0" ]; then exit $?; fi
Expand Down Expand Up @@ -50,6 +54,7 @@ IFS=',' read -r -a submodules <<< "${CM_GIT_SUBMODULES}"

for submodule in "${submodules[@]}"
do
echo ""
echo "Initializing submodule ${submodule}"
git submodule update --init "${submodule}"
if [ "${?}" != "0" ]; then exit $?; fi
Expand All @@ -59,9 +64,11 @@ if [ ${CM_GIT_PATCH} == "yes" ]; then
IFS=', ' read -r -a patch_files <<< ${CM_GIT_PATCH_FILEPATHS}
for patch_file in "${patch_files[@]}"
do
echo ""
echo "Applying patch $patch_file"
git apply "$patch_file"
if [ "${?}" != "0" ]; then exit $?; fi
done
fi

cd "$CUR_DIR"

0 comments on commit 9679c1d

Please sign in to comment.