From 56c5590fc97bde540530b14f8656b14c3ab7bf2c Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Wed, 20 Mar 2024 12:42:07 +0300 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=BA=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B0=20=D0=B8=D1=81=D1=85=D0=BE=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2,=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BB=D1=83=D1=87=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20=D0=BF=D1=83=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6=D0=B8=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B5=20ASCII=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB?= =?UTF-8?q?=D1=8B=20(`findstr`=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B6=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=20Unicode=20?= =?UTF-8?q?=D0=B8=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20=D0=BD?= =?UTF-8?q?=D0=B0=20`find`).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/edt-validate.cmd | 2 +- scripts/ext2cfe.cmd | 4 ++-- scripts/ext2edt.cmd | 2 +- scripts/ext2ib.cmd | 4 ++-- scripts/ext2xml.cmd | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/edt-validate.cmd b/scripts/edt-validate.cmd index 3a22aa5..09f978f 100644 --- a/scripts/edt-validate.cmd +++ b/scripts/edt-validate.cmd @@ -95,7 +95,7 @@ IF /i "%V8_SRC_PATH:~-4%" equ ".cfe" ( goto validate ) IF exist "%V8_SRC_PATH%\Configuration.xml" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( call %~dp0ext2edt.cmd "%V8_SRC_PATH%" "%VALIDATE_PATH%" goto validate ) diff --git a/scripts/ext2cfe.cmd b/scripts/ext2cfe.cmd index 74d5054..45417d2 100644 --- a/scripts/ext2cfe.cmd +++ b/scripts/ext2cfe.cmd @@ -105,7 +105,7 @@ echo [INFO] Checking 1C extension source type... IF exist "%V8_SRC_PATH%\DT-INF\" ( IF exist "%V8_SRC_PATH%\src\Configuration\Configuration.mdo" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( echo [INFO] Source type: 1C:EDT project md "%XML_PATH%" md "%WS_PATH%" @@ -115,7 +115,7 @@ IF exist "%V8_SRC_PATH%\DT-INF\" ( ) ) IF exist "%V8_SRC_PATH%\Configuration.xml" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( echo [INFO] Source type: 1C:Designer XML files set XML_PATH=%V8_SRC_PATH% set V8_SRC_TYPE=xml diff --git a/scripts/ext2edt.cmd b/scripts/ext2edt.cmd index 5b3aa7e..0784c0b 100644 --- a/scripts/ext2edt.cmd +++ b/scripts/ext2edt.cmd @@ -111,7 +111,7 @@ IF /i "%V8_SRC_PATH:~-4%" equ ".cfe" ( goto base_ib ) IF exist "%V8_SRC_PATH%\Configuration.xml" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( echo [INFO] Source type: 1C:Designer XML files set XML_PATH=%V8_SRC_PATH% set V8_SRC_TYPE=xml diff --git a/scripts/ext2ib.cmd b/scripts/ext2ib.cmd index fa4e69b..6f01ba8 100644 --- a/scripts/ext2ib.cmd +++ b/scripts/ext2ib.cmd @@ -144,7 +144,7 @@ echo [INFO] Checking 1C extension source type... IF exist "%V8_SRC_PATH%\DT-INF\" ( IF exist "%V8_SRC_PATH%\src\Configuration\Configuration.mdo" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( echo [INFO] Source type: 1C:EDT project md "%XML_PATH%" md "%WS_PATH%" @@ -153,7 +153,7 @@ IF exist "%V8_SRC_PATH%\DT-INF\" ( ) ) IF exist "%V8_SRC_PATH%\Configuration.xml" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\Configuration.xml"') DO ( echo [INFO] Source type: 1C:Designer XML files set XML_PATH=%V8_SRC_PATH% goto export_xml diff --git a/scripts/ext2xml.cmd b/scripts/ext2xml.cmd index 4d8eae8..d383c37 100644 --- a/scripts/ext2xml.cmd +++ b/scripts/ext2xml.cmd @@ -111,7 +111,7 @@ IF /i "%V8_SRC_PATH:~-4%" equ ".cfe" ( ) IF exist "%V8_SRC_PATH%\DT-INF\" ( IF exist "%V8_SRC_PATH%\src\Configuration\Configuration.mdo" ( - FOR /F "delims=" %%t IN ('findstr /r /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( + FOR /F "delims=" %%t IN ('find /i "" "%V8_SRC_PATH%\src\Configuration\Configuration.mdo"') DO ( echo [INFO] Source type: 1C:EDT project set V8_SRC_TYPE=edt goto base_ib From 8a09b8944b35a6047303408b176de2acbedee5ab Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Wed, 20 Mar 2024 12:43:24 +0300 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=D0=92=20=D0=BF=D1=80=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D1=85=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=20=D0=BF=D1=80=D0=B5=D0=B4=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B0=20=D0=B2=20=D0=B8=D1=81?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=BD=D0=B8=D0=BA=D0=B8=20=D0=B2=D0=BE=20?= =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3,=20=D1=87=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=20=D0=B2=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B5=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B2=D1=8B=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B7=D0=BA=D0=B8=20=D0=BD=D0=B5=20=D0=BE=D1=87=D0=B8?= =?UTF-8?q?=D1=89=D0=B0=D0=BB=D1=81=D1=8F=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=BA=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=20=D0=B8=D1=81=D1=85=D0=BE=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/conf_ib2xml.cmd | 53 +++++++++++++++++----- examples/ext_ib2xml.cmd | 53 +++++++++++++++++----- examples/ib2xml.cmd | 98 ++++++++++++++++++++++++++++++---------- 3 files changed, 156 insertions(+), 48 deletions(-) diff --git a/examples/conf_ib2xml.cmd b/examples/conf_ib2xml.cmd index cacfed7..fe1ed94 100644 --- a/examples/conf_ib2xml.cmd +++ b/examples/conf_ib2xml.cmd @@ -11,6 +11,8 @@ set RELATIVE_SRC_PATH=src set RELATIVE_SRC_CF_PATH=cf set RELATIVE_SRC_CFE_PATH=cfe +IF not defined V8_TEMP set V8_TEMP=%TEMP%\%~n0 + FOR /F "usebackq tokens=1 delims=" %%i IN (`FORFILES /P "%RELATIVE_REPO_PATH%" /M "%RELATIVE_SRC_PATH%" /C "cmd /c echo @path"`) DO set SRC_PATH=%%i IF not defined SRC_PATH ( echo [ERROR] Path to source files "%RELATIVE_REPO_PATH%\%RELATIVE_SRC_PATH%" not found @@ -57,21 +59,48 @@ echo ====== echo Export main configuration echo ====== -call %REPO_PATH%\tools\1CFilesConverter\scripts\conf2xml.cmd "%V8_CONNECTION_STRING%" "%CONF_PATH%" - -if exist "%REPO_PATH%\.git" ( - set "GIT_COMMAND=git status --short -- "%CONF_PATH%"" - FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( - IF "%%a" equ "D" ( - set PATH_TO_RESTORE=%%b - set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! - set RESTORE_FILE=0 - FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CF_PATH%\%%i" set RESTORE_FILE=1 - IF "!RESTORE_FILE!" equ "1" git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 +set TEMP_CONF_PATH=%V8_TEMP%\src +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" +) +IF not exist "%TEMP_CONF_PATH%" md "%TEMP_CONF_PATH%" + +call %REPO_PATH%\tools\1CFilesConverter\scripts\conf2xml.cmd "%V8_CONNECTION_STRING%" "%TEMP_CONF_PATH%" + +IF ERRORLEVEL == 0 ( + IF exist "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" + + echo [INFO] Clear destination folder: %CONF_PATH% + IF exist "%CONF_PATH%" IF "%V8_CONF_XML_CLEAN_DST%" equ "1" ( + del /f /s /q "%CONF_PATH%\*.*" > nul + rd /S /Q "%CONF_PATH%" + ) + IF not exist "%CONF_PATH%" md "%CONF_PATH%" + + echo [INFO] Moving sources from temporary path "%TEMP_CONF_PATH%" to "%CONF_PATH%" + FOR /f "usebackq delims=" %%f in (`dir /b "%TEMP_CONF_PATH%"`) DO move /Y "%TEMP_CONF_PATH%\%%f" "%CONF_PATH%" > nul + + IF exist "%REPO_PATH%\.git" ( + set "GIT_COMMAND=git status --short -- "%CONF_PATH%"" + FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( + IF "%%a" equ "D" ( + set PATH_TO_RESTORE=%%b + set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! + set RESTORE_FILE=0 + FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CF_PATH%\%%i" set RESTORE_FILE=1 + IF "!RESTORE_FILE!" equ "1" ( + echo [INFO] Restoring special file "!PATH_TO_RESTORE!" + git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 + ) + ) ) ) ) -IF exist "%CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%CONF_PATH%\ConfigDumpInfo.xml" +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" +) echo FINISH: %date% %time% diff --git a/examples/ext_ib2xml.cmd b/examples/ext_ib2xml.cmd index 8e92050..35b5f3c 100644 --- a/examples/ext_ib2xml.cmd +++ b/examples/ext_ib2xml.cmd @@ -11,6 +11,8 @@ set RELATIVE_SRC_PATH=src set RELATIVE_SRC_CF_PATH=cf set RELATIVE_SRC_CFE_PATH=cfe +IF not defined V8_TEMP set V8_TEMP=%TEMP%\%~n0 + FOR /F "usebackq tokens=1 delims=" %%i IN (`FORFILES /P "%RELATIVE_REPO_PATH%" /M "%RELATIVE_SRC_PATH%" /C "cmd /c echo @path"`) DO set SRC_PATH=%%i IF not defined SRC_PATH ( echo [ERROR] Path to source files "%RELATIVE_REPO_PATH%\%RELATIVE_SRC_PATH%" not found @@ -57,21 +59,48 @@ echo ====== echo Export extension "%V8_EXT_NAME%" echo ====== -call %REPO_PATH%\tools\1CFilesConverter\scripts\ext2xml.cmd "%V8_CONNECTION_STRING%" "%EXT_PATH%\%V8_EXT_NAME%" "%V8_EXT_NAME%" - -if exist "%REPO_PATH%\.git" ( - set "GIT_COMMAND=git status --short -- "%EXT_PATH%\%V8_EXT_NAME%"" - FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( - IF "%%a" equ "D" ( - set PATH_TO_RESTORE=%%b - set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! - set RESTORE_FILE=0 - FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CFE_PATH%\%V8_EXT_NAME%\%%i" set RESTORE_FILE=1 - IF "!RESTORE_FILE!" equ "1" git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 +set TEMP_CONF_PATH=%V8_TEMP%\src +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" +) +IF not exist "%TEMP_CONF_PATH%" md "%TEMP_CONF_PATH%" + +call %REPO_PATH%\tools\1CFilesConverter\scripts\ext2xml.cmd "%V8_CONNECTION_STRING%" "%TEMP_CONF_PATH%" "%V8_EXT_NAME%" + +IF ERRORLEVEL == 0 ( + IF exist "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" + + echo [INFO] Clear destination folder "%EXT_PATH%\%V8_EXT_NAME%" + IF exist "%EXT_PATH%\%V8_EXT_NAME%" IF "%V8_EXT_XML_CLEAN_DST%" equ "1" ( + del /f /s /q "%EXT_PATH%\%V8_EXT_NAME%\*.*" > nul + rd /S /Q "%EXT_PATH%\%V8_EXT_NAME%" + ) + IF not exist "%EXT_PATH%\%V8_EXT_NAME%" md "%EXT_PATH%\%V8_EXT_NAME%" + + echo [INFO] Moving sources from temporary path "%TEMP_CONF_PATH%" to "%EXT_PATH%\%V8_EXT_NAME%" + FOR /f "usebackq delims=" %%f in (`dir /b "%TEMP_CONF_PATH%"`) DO move /Y "%TEMP_CONF_PATH%\%%f" "%EXT_PATH%\%V8_EXT_NAME%" > nul + + IF exist "%REPO_PATH%\.git" ( + set "GIT_COMMAND=git status --short -- "%EXT_PATH%\%V8_EXT_NAME%"" + FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( + IF "%%a" equ "D" ( + set PATH_TO_RESTORE=%%b + set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! + set RESTORE_FILE=0 + FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CFE_PATH%\%V8_EXT_NAME%\%%i" set RESTORE_FILE=1 + IF "!RESTORE_FILE!" equ "1" ( + echo [INFO] Restoring special file "!PATH_TO_RESTORE!" + git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 + ) + ) ) ) ) -IF exist "%EXT_PATH%\%%j\ConfigDumpInfo.xml" del /Q /F "%EXT_PATH%\%V8_EXT_NAME%\ConfigDumpInfo.xml" +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" +) echo FINISH: %date% %time% diff --git a/examples/ib2xml.cmd b/examples/ib2xml.cmd index 265f310..39cef11 100644 --- a/examples/ib2xml.cmd +++ b/examples/ib2xml.cmd @@ -11,6 +11,8 @@ set RELATIVE_SRC_PATH=src set RELATIVE_SRC_CF_PATH=cf set RELATIVE_SRC_CFE_PATH=cfe +IF not defined V8_TEMP set V8_TEMP=%TEMP%\%~n0 + FOR /F "usebackq tokens=1 delims=" %%i IN (`FORFILES /P "%RELATIVE_REPO_PATH%" /M "%RELATIVE_SRC_PATH%" /C "cmd /c echo @path"`) DO set SRC_PATH=%%i IF not defined SRC_PATH ( echo [ERROR] Path to source files "%RELATIVE_REPO_PATH%\%RELATIVE_SRC_PATH%" not found @@ -70,23 +72,45 @@ echo ====== echo Export main configuration echo ====== -call %REPO_PATH%\tools\1CFilesConverter\scripts\conf2xml.cmd "%V8_CONNECTION_STRING%" "%CONF_PATH%" - -if exist "%REPO_PATH%\.git" ( - set "GIT_COMMAND=git status --short -- "%CONF_PATH%"" - FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( - IF "%%a" equ "D" ( - set PATH_TO_RESTORE=%%b - set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! - set RESTORE_FILE=0 - FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CF_PATH%\%%i" set RESTORE_FILE=1 - IF "!RESTORE_FILE!" equ "1" git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 +set TEMP_CONF_PATH=%V8_TEMP%\src +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" +) +IF not exist "%TEMP_CONF_PATH%" md "%TEMP_CONF_PATH%" + +call %REPO_PATH%\tools\1CFilesConverter\scripts\conf2xml.cmd "%V8_CONNECTION_STRING%" "%TEMP_CONF_PATH%" + +IF ERRORLEVEL == 0 ( + IF exist "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" + + echo [INFO] Clear destination folder: %CONF_PATH% + IF exist "%CONF_PATH%" IF "%V8_CONF_XML_CLEAN_DST%" equ "1" ( + del /f /s /q "%CONF_PATH%\*.*" > nul + rd /S /Q "%CONF_PATH%" + ) + IF not exist "%CONF_PATH%" md "%CONF_PATH%" + + echo [INFO] Moving sources from temporary path "%TEMP_CONF_PATH%" to "%CONF_PATH%" + FOR /f "usebackq delims=" %%f in (`dir /b "%TEMP_CONF_PATH%"`) DO move /Y "%TEMP_CONF_PATH%\%%f" "%CONF_PATH%" > nul + + IF exist "%REPO_PATH%\.git" ( + set "GIT_COMMAND=git status --short -- "%CONF_PATH%"" + FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( + IF "%%a" equ "D" ( + set PATH_TO_RESTORE=%%b + set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! + set RESTORE_FILE=0 + FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CF_PATH%\%%i" set RESTORE_FILE=1 + IF "!RESTORE_FILE!" equ "1" ( + echo [INFO] Restoring special file "!PATH_TO_RESTORE!" + git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 + ) + ) ) ) ) -IF exist "%CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%CONF_PATH%\ConfigDumpInfo.xml" - FOR %%j IN (%V8_EXTENSIONS%) DO ( set EXT_NAME=%%j @@ -95,22 +119,48 @@ FOR %%j IN (%V8_EXTENSIONS%) DO ( echo Export extension "!EXT_NAME!" echo ====== - call %REPO_PATH%\tools\1CFilesConverter\scripts\ext2xml.cmd "%V8_CONNECTION_STRING%" "%EXT_PATH%\!EXT_NAME!" "!EXT_NAME!" + IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" + ) + IF not exist "%TEMP_CONF_PATH%" md "%TEMP_CONF_PATH%" + + call %REPO_PATH%\tools\1CFilesConverter\scripts\ext2xml.cmd "%V8_CONNECTION_STRING%" "%TEMP_CONF_PATH%" "!EXT_NAME!" - if exist "%REPO_PATH%\.git" ( - set "GIT_COMMAND=git status --short -- "%EXT_PATH%\!EXT_NAME!"" - FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( - IF "%%a" equ "D" ( - set PATH_TO_RESTORE=%%b - set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! - set RESTORE_FILE=0 - FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CFE_PATH%\!EXT_NAME!\%%i" set RESTORE_FILE=1 - IF "!RESTORE_FILE!" equ "1" git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 + IF ERRORLEVEL == 0 ( + IF exist "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" del /Q /F "%TEMP_CONF_PATH%\ConfigDumpInfo.xml" + + echo [INFO] Clear destination folder "%EXT_PATH%\!EXT_NAME!" + IF exist "%EXT_PATH%\!EXT_NAME!" IF "%V8_EXT_XML_CLEAN_DST%" equ "1" ( + del /f /s /q "%EXT_PATH%\!EXT_NAME!\*.*" > nul + rd /S /Q "%EXT_PATH%\!EXT_NAME!" + ) + IF not exist "%EXT_PATH%\!EXT_NAME!" md "%EXT_PATH%\!EXT_NAME!" + + echo [INFO] Moving sources from temporary path "%TEMP_CONF_PATH%" to "%EXT_PATH%\!EXT_NAME!" + FOR /f "usebackq delims=" %%f in (`dir /b "%TEMP_CONF_PATH%"`) DO move /Y "%TEMP_CONF_PATH%\%%f" "%EXT_PATH%\!EXT_NAME!%" > nul + + IF exist "%REPO_PATH%\.git" ( + set "GIT_COMMAND=git status --short -- "%EXT_PATH%\!EXT_NAME!"" + FOR /f "tokens=1,2 delims= " %%a in (' "!GIT_COMMAND!" ') do ( + IF "%%a" equ "D" ( + set PATH_TO_RESTORE=%%b + set PATH_TO_RESTORE=!PATH_TO_RESTORE:/=\! + set RESTORE_FILE=0 + FOR %%i IN (%V8_FILES_TO_KEEP%) DO IF "!PATH_TO_RESTORE!" equ "%RELATIVE_SRC_PATH%\%RELATIVE_SRC_CFE_PATH%\!EXT_NAME!\%%i" set RESTORE_FILE=1 + IF "!RESTORE_FILE!" equ "1" ( + echo [INFO] Restoring special file "!PATH_TO_RESTORE!" + git checkout HEAD "!PATH_TO_RESTORE!" > nul 2>&1 + ) + ) ) ) ) +) - IF exist "%EXT_PATH%\!EXT_NAME!\ConfigDumpInfo.xml" del /Q /F "%EXT_PATH%\!EXT_NAME!\ConfigDumpInfo.xml" +IF exist "%TEMP_CONF_PATH%" ( + del /f /s /q "%TEMP_CONF_PATH%\*.*" > nul + rd /S /Q "%TEMP_CONF_PATH%" ) echo FINISH: %date% %time% From 9bb89d732105a7ee306e3a45f7b9b44fa257f81a Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Wed, 20 Mar 2024 12:44:08 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=20=D0=BD=D0=BE=D0=BC=D0=B5=D1=80=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D0=B8=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=BE=D0=B2?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8e03717..a73b432 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.1 \ No newline at end of file +1.5.2 \ No newline at end of file