From 5df627d4cfb9a1199e39f20c3201daf87efce4d2 Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Sat, 22 Jul 2023 11:06:53 +0300 Subject: [PATCH] =?UTF-8?q?style:=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=84=D0=BE=D1=80=D0=BC=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0,=20=D1=83?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BA=D0=BE=D0=B1=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cf2edt.cmd | 52 ++++++++++++++------------------------ scripts/cf2ib.cmd | 22 ++++++++-------- scripts/cf2xml.cmd | 36 +++++++++++--------------- scripts/dp-bin-dir2edt.cmd | 52 ++++++++++++++------------------------ scripts/dp-bin-dir2xml.cmd | 32 ++++++++++------------- scripts/dp-bin2edt.cmd | 52 ++++++++++++++------------------------ scripts/dp-bin2xml.cmd | 32 ++++++++++------------- scripts/dp-xml-dir2epf.cmd | 32 ++++++++++------------- scripts/dp-xml2epf.cmd | 32 ++++++++++------------- scripts/edt-validate.cmd | 28 +++++++++----------- scripts/edt2cf.cmd | 48 +++++++++++++---------------------- scripts/edt2ib.cmd | 40 +++++++++++------------------ scripts/edt2xml.cmd | 30 ++++++++-------------- scripts/ib2cf.cmd | 18 ++++++------- scripts/ib2edt.cmd | 40 +++++++++++------------------ scripts/ib2xml.cmd | 22 ++++++++-------- scripts/xml2cf.cmd | 32 ++++++++++------------- scripts/xml2edt.cmd | 32 ++++++++--------------- scripts/xml2ib.cmd | 22 ++++++++-------- tests/test.cmd | 14 +++++----- 20 files changed, 268 insertions(+), 400 deletions(-) diff --git a/scripts/cf2edt.cmd b/scripts/cf2edt.cmd index bc1fa75..b72e685 100644 --- a/scripts/cf2edt.cmd +++ b/scripts/cf2edt.cmd @@ -7,8 +7,8 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" @@ -21,49 +21,41 @@ set XML_PATH=%V8_TEMP%\tmp_xml set WS_PATH=%V8_TEMP%\edt_ws set CONFIG_FILE=%1 -if defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% +IF defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% set CONFIG_PATH=%2 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 1 "path to 1C configuration file" exit /b 1 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 2 "path to folder to save configuration files in 1C:EDT format" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%CONFIG_PATH%" ( - rd /S /Q "%CONFIG_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" md "%CONFIG_PATH%" echo Creating infobase "%IB_PATH%" from file "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_FILE%" -) else ( +) ELSE ( %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_FILE%" ) echo Export configuration from infobase "%IB_PATH%" to 1C:Designer XML format "%XML_PATH%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpConfigToFiles "%XML_PATH%" -force -) else ( +) ELSE ( %IBCMD_TOOL% infobase config export --db-path="%IB_PATH%" "%XML_PATH%" --force ) @@ -71,12 +63,6 @@ echo Export configuration from "%XML_PATH%" to 1C:EDT format "%CONFIG_PATH%"... call %RING_TOOL% edt workspace import --project "%CONFIG_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%" echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/cf2ib.cmd b/scripts/cf2ib.cmd index 7c111c4..4589840 100644 --- a/scripts/cf2ib.cmd +++ b/scripts/cf2ib.cmd @@ -7,37 +7,35 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set CONFIG_FILE=%1 -if defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% +IF defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% set IB_PATH=%2 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 1 "path to 1C configuration file" exit /b 1 ) -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 2 "path to folder contains 1C infobase" exit /b 1 ) echo Clear infobase folder "%IB_PATH%"... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" echo Creating infobase "%IB_PATH%" from file "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_FILE%" -) else ( +) ELSE ( %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_FILE%" ) diff --git a/scripts/cf2xml.cmd b/scripts/cf2xml.cmd index aab58c2..f226de2 100644 --- a/scripts/cf2xml.cmd +++ b/scripts/cf2xml.cmd @@ -7,55 +7,49 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set IB_PATH=%V8_TEMP%\tmp_db set CONFIG_FILE=%1 -if defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% +IF defined CONFIG_FILE set CONFIG_FILE=%CONFIG_FILE:"=% set CONFIG_PATH=%2 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 1 "path to 1C configuration file" exit /b 1 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 2 "path to folder to save configuration files in 1C:Designer XML format" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%CONFIG_PATH%" ( - rd /S /Q "%CONFIG_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" md "%CONFIG_PATH%" echo Creating infobase "%IB_PATH%" from file "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_FILE%" -) else ( +) ELSE ( %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_FILE%" ) echo Export configuration from infobase "%IB_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpConfigToFiles "%CONFIG_PATH%" -force -) else ( +) ELSE ( %IBCMD_TOOL% infobase config export --db-path="%IB_PATH%" "%CONFIG_PATH%" --force ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/dp-bin-dir2edt.cmd b/scripts/dp-bin-dir2edt.cmd index 89ac2dd..f3658f5 100644 --- a/scripts/dp-bin-dir2edt.cmd +++ b/scripts/dp-bin-dir2edt.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save 1C data processors & reports in 1C:EDT format rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO ( @@ -20,21 +20,21 @@ set WS_PATH=%V8_TEMP%\edt_ws set CLEAN_AFTER_EXPORT=0 set DP_BIN_PATH=%1 -if defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% +IF defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% set DP_SRC_PATH=%2 -if defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% +IF defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_BIN_PATH ( +IF not defined DP_BIN_PATH ( echo Missed parameter 1 "path to folder contains data processors & reports in binary format (*.epf, *.erf)" exit /b 1 ) -if not defined DP_SRC_PATH ( +IF not defined DP_SRC_PATH ( echo Missed parameter 2 "path to folder to save 1C data processors & reports in 1C:EDT format" exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -45,20 +45,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -67,18 +67,10 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%DP_SRC_PATH%" ( - rd /S /Q "%DP_SRC_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%DP_SRC_PATH%" rd /S /Q "%DP_SRC_PATH%" md "%V8_TEMP%" md "%XML_PATH%" md "%WS_PATH%" @@ -103,12 +95,6 @@ echo Export dataprocessors ^& reports from 1C:Designer XML format "%XML_PATH%" t call %RING_TOOL% edt workspace import --project "%DP_SRC_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%" echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/dp-bin-dir2xml.cmd b/scripts/dp-bin-dir2xml.cmd index 35ceef5..d09f9f1 100644 --- a/scripts/dp-bin-dir2xml.cmd +++ b/scripts/dp-bin-dir2xml.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save 1C data processors & reports in 1C:Designer XML rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" @@ -15,21 +15,21 @@ set IB_PATH=%V8_TEMP%\tmp_db set CLEAN_AFTER_EXPORT=0 set DP_BIN_PATH=%1 -if defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% +IF defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% set DP_SRC_PATH=%2 -if defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% +IF defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_BIN_PATH ( +IF not defined DP_BIN_PATH ( echo Missed parameter 1 "path to folder contains data processors & reports in binary format (*.epf, *.erf)" exit /b 1 ) -if not defined DP_SRC_PATH ( +IF not defined DP_SRC_PATH ( echo Missed parameter 2 "path to folder to save 1C data processors & reports in 1C:Designer XML format" exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -40,20 +40,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -62,9 +62,7 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%DP_SRC_PATH%" echo Export dataprocessors from folder "%DP_BIN_PATH%" to 1C:Designer XML format "%DP_SRC_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... @@ -83,6 +81,4 @@ FOR /f %%f IN ('dir /b /a-d "%DP_BIN_PATH%\*.erf"') DO ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/dp-bin2edt.cmd b/scripts/dp-bin2edt.cmd index e6ba9af..3eec572 100644 --- a/scripts/dp-bin2edt.cmd +++ b/scripts/dp-bin2edt.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save data processor & report in 1C:EDT format rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO ( @@ -20,21 +20,21 @@ set WS_PATH=%V8_TEMP%\edt_ws set CLEAN_AFTER_EXPORT=0 set DP_FILE=%1 -if defined DP_FILE set DP_FILE=%DP_FILE:"=% +IF defined DP_FILE set DP_FILE=%DP_FILE:"=% set DP_PATH=%2 -if defined DP_PATH set DP_PATH=%DP_PATH:"=% +IF defined DP_PATH set DP_PATH=%DP_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_FILE ( +IF not defined DP_FILE ( echo Missed parameter 1 "path to 1C data processor or report (*.epf, *.erf)" exit /b 1 ) -if not defined DP_PATH ( +IF not defined DP_PATH ( echo Missed parameter 2 "path to folder to save data processor & report in 1C:EDT format" exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -45,20 +45,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -67,18 +67,10 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%DP_PATH%" ( - rd /S /Q "%DP_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%DP_PATH%" rd /S /Q "%DP_PATH%" md "%XML_PATH%" md "%WS_PATH%" md "%DP_PATH%" @@ -90,12 +82,6 @@ echo Export dataprocessor / report from 1C:Designer XML format "%XML_PATH%" to 1 call %RING_TOOL% edt workspace import --project "%DP_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%" echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/dp-bin2xml.cmd b/scripts/dp-bin2xml.cmd index 2be223a..3f3df8a 100644 --- a/scripts/dp-bin2xml.cmd +++ b/scripts/dp-bin2xml.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save data processor & report in 1C:Designer XML forma rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" @@ -15,22 +15,22 @@ set IB_PATH=%V8_TEMP%\tmp_db set CLEAN_AFTER_EXPORT=0 set DP_FILE=%1 -if defined DP_FILE set DP_FILE=%DP_FILE:"=% +IF defined DP_FILE set DP_FILE=%DP_FILE:"=% set DP_PATH=%2 -if defined DP_PATH set DP_PATH=%DP_PATH:"=% +IF defined DP_PATH set DP_PATH=%DP_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_FILE ( +IF not defined DP_FILE ( echo Missed parameter 1 "path to 1C data processor or report (*.epf, *.erf)". exit /b 1 ) -if not defined DP_PATH ( +IF not defined DP_PATH ( echo Missed parameter 2 "path to folder to save data processor & report in 1C:Designer XML format". exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -41,20 +41,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -63,15 +63,11 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%DP_PATH%" echo Export dataprocessor / report "%DP_FILE%" to 1C:Designer XML format "%DP_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "%DP_PATH%" "%DP_FILE%" echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/dp-xml-dir2epf.cmd b/scripts/dp-xml-dir2epf.cmd index 4cf5fc0..bd2227e 100644 --- a/scripts/dp-xml-dir2epf.cmd +++ b/scripts/dp-xml-dir2epf.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save data processors & reports in binary format (*.ep rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" @@ -15,21 +15,21 @@ set IB_PATH=%V8_TEMP%\tmp_db set CLEAN_AFTER_EXPORT=0 set DP_SRC_PATH=%1 -if defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% +IF defined DP_SRC_PATH set DP_SRC_PATH=%DP_SRC_PATH:"=% set DP_BIN_PATH=%2 -if defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% +IF defined DP_BIN_PATH set DP_BIN_PATH=%DP_BIN_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_SRC_PATH ( +IF not defined DP_SRC_PATH ( echo Missed parameter 1 "path to folder contains 1C data processors & reports in 1C:Designer XML format" exit /b 1 ) -if not defined DP_BIN_PATH ( +IF not defined DP_BIN_PATH ( echo Missed parameter 2 "path to folder to save data processors & reports in binary format (*.epf, *.erf)" exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -40,20 +40,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -62,9 +62,7 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%DP_BIN_PATH%" echo Import dataprocessors ^& reports from folder "%DP_SRC_PATH%" to 1C:Designer format "%DP_BIN_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... @@ -76,6 +74,4 @@ FOR /f %%f IN ('dir /b /a-d "%DP_SRC_PATH%\*.xml"') DO ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/dp-xml2epf.cmd b/scripts/dp-xml2epf.cmd index c164f12..6ac4cf2 100644 --- a/scripts/dp-xml2epf.cmd +++ b/scripts/dp-xml2epf.cmd @@ -6,8 +6,8 @@ rem %2 - path to folder to save data processor & report in binary format rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem or folder contains 1C infobase used for convertion -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" @@ -15,21 +15,21 @@ set IB_PATH=%V8_TEMP%\tmp_db set CLEAN_AFTER_EXPORT=0 set DP_FILE=%1 -if defined DP_FILE set DP_FILE=%DP_FILE:"=% +IF defined DP_FILE set DP_FILE=%DP_FILE:"=% set DP_PATH=%2 -if defined DP_PATH set DP_PATH=%DP_PATH:"=% +IF defined DP_PATH set DP_PATH=%DP_PATH:"=% set BASE_CONFIG=%3 -if defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% +IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=% -if not defined DP_FILE ( +IF not defined DP_FILE ( echo Missed parameter 1 "path to main file of 1C data processor or report in 1C:Designer XML format (*.xml)" exit /b 1 ) -if not defined DP_PATH ( +IF not defined DP_PATH ( echo Missed parameter 2 "path to folder to save data processor & report in binary format" exit /b 1 ) -if not exist "%BASE_CONFIG%" ( +IF not exist "%BASE_CONFIG%" ( echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used. set BASE_CONFIG= ) @@ -40,20 +40,20 @@ IF "%BASE_CONFIG%" equ "" ( set CLEAN_AFTER_EXPORT=1 set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) else ( +) ELSE ( set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" IF exist "%BASE_CONFIG%\DT-INF\" ( set CLEAN_AFTER_EXPORT=1 call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\Configuration.xml" ( set CLEAN_AFTER_EXPORT=1 call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) else ( + ) ELSE ( IF exist "%BASE_CONFIG%\1cv8.1cd" ( set BASE_CONFIG_DESCRIPTION=existed configuration set IB_PATH=%BASE_CONFIG% - ) else ( + ) ELSE ( set CLEAN_AFTER_EXPORT=1 call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" ) @@ -62,15 +62,11 @@ IF "%BASE_CONFIG%" equ "" ( ) echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%DP_PATH%" echo Import dataprocessor / report "%DP_FILE%" to 1C:Designer format "%DP_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "%DP_FILE%" "%DP_PATH%" echo Clear temporary files... -IF "%CLEAN_AFTER_EXPORT%" equ "1" ( - rd /S /Q "%IB_PATH%" -) +IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/edt-validate.cmd b/scripts/edt-validate.cmd index 639e302..7f4fcc9 100644 --- a/scripts/edt-validate.cmd +++ b/scripts/edt-validate.cmd @@ -4,8 +4,8 @@ rem Validate 1C configuration using 1C:EDT (ring tool) rem %1 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format) rem %2 - path to validation report file -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO ( set RING_TOOL="%%i" @@ -18,37 +18,35 @@ set WS_PATH=%V8_TEMP%\edt_ws set CLEAN_AFTER_VALIDATION=0 set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set REPORT_FILE=%2 -if defined REPORT_FILE ( +IF defined REPORT_FILE ( set REPORT_FILE=%REPORT_FILE:"=% set REPORT_FILE_PATH=%~dp2 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format)" exit /b 1 ) -if not defined REPORT_FILE ( +IF not defined REPORT_FILE ( echo Missed parameter 2 "path to validation report file" exit /b 1 ) echo Clear temporary files... -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -del "%REPORT_FILE%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%REPORT_FILE_PATH%" rd /S /Q "%REPORT_FILE_PATH%" md "%REPORT_FILE_PATH%" echo Prepare project for validation... IF exist "%CONFIG_PATH%\DT-INF\" ( set VALIDATE_PATH=%CONFIG_PATH% -) else ( +) ELSE ( set CLEAN_AFTER_VALIDATION=1 IF exist "%CONFIG_PATH%\Configuration.xml" ( call %~dp0xml2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" - ) else ( + ) ELSE ( call %~dp0cf2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" ) ) @@ -57,7 +55,5 @@ echo Run validation in "%VALIDATE_PATH%"... call %RING_TOOL% edt workspace validate --project-list "%VALIDATE_PATH%" --workspace-location "%WS_PATH%" --file "%REPORT_FILE%" echo Clear temporary files... -rd /S /Q "%WS_PATH%" -IF "%CLEAN_AFTER_VALIDATION%" equ "1" ( - rd /S /Q "%VALIDATE_PATH%" -) +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF "%CLEAN_AFTER_VALIDATION%" equ "1" IF exist "%VALIDATE_PATH%" rd /S /Q "%VALIDATE_PATH%" diff --git a/scripts/edt2cf.cmd b/scripts/edt2cf.cmd index f0a511c..12634ee 100644 --- a/scripts/edt2cf.cmd +++ b/scripts/edt2cf.cmd @@ -7,8 +7,8 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" @@ -21,36 +21,30 @@ set XML_PATH=%V8_TEMP%\tmp_xml set WS_PATH=%V8_TEMP%\edt_ws set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONFIG_FILE=%2 -if defined CONFIG_FILE ( +IF defined CONFIG_FILE ( set CONFIG_FILE=%CONFIG_FILE:"=% set CONFIG_FILE_PATH=%~dp2 ) set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:EDT format" exit /b 1 ) -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 2 "path to 1C configuration file (*.cf)" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" md "%V8_TEMP%" md "%XML_PATH%" md "%WS_PATH%" @@ -59,31 +53,25 @@ md "%CONFIG_FILE_PATH%" echo Export "%CONFIG_PATH%" to 1C:Designer XML format "%XML_PATH%"... call %RING_TOOL% edt workspace export --project "%CONFIG_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( echo Creating infobase "%IB_PATH%"... %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs echo Loading infobase "%IB_PATH%" configuration from XML-files "%XML_PATH%"... %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /LoadConfigFromFiles %XML_PATH% -) else ( +) ELSE ( echo Creating infobase "%IB_PATH%" with configuration from XML-files "%XML_PATH%"... %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%XML_PATH%" ) echo Export infobase "%IB_PATH%" configuration to "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /DumpCfg %CONFIG_FILE% -) else ( +) ELSE ( %IBCMD_TOOL% infobase config save --db-path="%IB_PATH%" "%CONFIG_FILE%" ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/edt2ib.cmd b/scripts/edt2ib.cmd index 632dc2b..79fca41 100644 --- a/scripts/edt2ib.cmd +++ b/scripts/edt2ib.cmd @@ -7,8 +7,8 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" @@ -20,30 +20,26 @@ set XML_PATH=%V8_TEMP%\tmp_xml set WS_PATH=%V8_TEMP%\edt_ws set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set IB_PATH=%2 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:EDT format" exit /b 1 ) -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 2 "path to folder contains 1C infobase" exit /b 1 ) echo Clear temporary files... -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" md "%V8_TEMP%" md "%XML_PATH%" md "%WS_PATH%" @@ -52,25 +48,19 @@ echo Export "%CONFIG_PATH%" to 1C:Designer XML format "%XML_PATH%"... call %RING_TOOL% edt workspace export --project "%CONFIG_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" echo Clear infobase folder "%IB_PATH%"... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( echo Creating infobase "%IB_PATH%"... %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs echo Loading infobase "%IB_PATH%" configuration from XML-files "%XML_PATH%"... %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /LoadConfigFromFiles %XML_PATH% -) else ( +) ELSE ( echo Creating infobase "%IB_PATH%" with configuration from XML-files "%XML_PATH%"... %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%XML_PATH%" ) echo Clear temporary files... -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/edt2xml.cmd b/scripts/edt2xml.cmd index 1b7121b..a9c1ef2 100644 --- a/scripts/edt2xml.cmd +++ b/scripts/edt2xml.cmd @@ -4,7 +4,7 @@ rem Convert 1C configuration from 1C:EDT format to 1C:Designer XML format rem %1 - path to folder contains configuration files in 1C:EDT format rem %2 - path to folder to save configuration files in 1C:Designer XML format -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO ( set RING_TOOL="%%i" @@ -14,38 +14,28 @@ set IB_PATH=%V8_TEMP%\tmp_db set WS_PATH=%V8_TEMP%\edt_ws set EDT_PATH=%1 -if defined EDT_PATH set EDT_PATH=%EDT_PATH:"=% +IF defined EDT_PATH set EDT_PATH=%EDT_PATH:"=% set CONFIG_PATH=%2 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% -if not defined EDT_PATH ( +IF not defined EDT_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:EDT format" exit /b 1 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 2 "path to folder to save configuration files in 1C:Designer XML format" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%CONFIG_PATH%" ( - rd /S /Q "%CONFIG_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" md "%CONFIG_PATH%" echo Export "%EDT_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... call %RING_TOOL% edt workspace export --project "%EDT_PATH%" --configuration-files "%CONFIG_PATH%" --workspace-location "%WS_PATH%" echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/ib2cf.cmd b/scripts/ib2cf.cmd index 7c1c290..cf3af0e 100644 --- a/scripts/ib2cf.cmd +++ b/scripts/ib2cf.cmd @@ -7,28 +7,28 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set IB_PATH=%1 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONFIG_FILE=%2 -if defined CONFIG_FILE ( +IF defined CONFIG_FILE ( set CONFIG_FILE=%CONFIG_FILE:"=% set CONFIG_FILE_PATH=%~dp2 ) set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 1 "path to folder contains 1C infobase" exit /b 1 ) -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 2 "path to 1C configuration file (*.cf)" exit /b 1 ) @@ -36,8 +36,8 @@ if not defined CONFIG_FILE ( md "%CONFIG_FILE_PATH%" echo Export infobase "%IB_PATH%" configuration to "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /DumpCfg %CONFIG_FILE% -) else ( +) ELSE ( %IBCMD_TOOL% infobase config save --db-path="%IB_PATH%" "%CONFIG_FILE%" ) diff --git a/scripts/ib2edt.cmd b/scripts/ib2edt.cmd index acbc97f..1347933 100644 --- a/scripts/ib2edt.cmd +++ b/scripts/ib2edt.cmd @@ -7,8 +7,8 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" @@ -20,39 +20,33 @@ set XML_PATH=%V8_TEMP%\tmp_xml set WS_PATH=%V8_TEMP%\edt_ws set IB_PATH=%1 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONFIG_PATH=%2 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 1 "path to folder contains 1C infobase" exit /b 1 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 2 "path to 1C configuration files in 1C:EDT format" exit /b 1 ) echo Clear temporary files... -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%CONFIG_PATH%" ( - rd /S /Q "%CONFIG_PATH%" -) +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" md "%CONFIG_PATH%" echo Export configuration from infobase "%IB_PATH%" to 1C:Designer XML format "%XML_PATH%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpConfigToFiles "%XML_PATH%" -force -) else ( +) ELSE ( %IBCMD_TOOL% infobase config export --db-path="%IB_PATH%" "%XML_PATH%" --force ) @@ -60,9 +54,5 @@ echo Export configuration from "%XML_PATH%" to 1C:EDT format "%CONFIG_PATH%"... call %RING_TOOL% edt workspace import --project "%CONFIG_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%" echo Clear temporary files... -if exist "%XML_PATH%" ( - rd /S /Q "%XML_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/ib2xml.cmd b/scripts/ib2xml.cmd index b436042..0f64e46 100644 --- a/scripts/ib2xml.cmd +++ b/scripts/ib2xml.cmd @@ -7,38 +7,36 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set IB_PATH=%1 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONFIG_PATH=%2 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 1 "path to folder contains 1C infobase" exit /b 1 ) -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 2 "path to 1C configuration files in 1C:Designer XML format" exit /b 1 ) echo Clear temporary files... -if exist "%CONFIG_PATH%" ( - rd /S /Q "%CONFIG_PATH%" -) +IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" md "%CONFIG_PATH%" echo Export configuration from infobase "%IB_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpConfigToFiles "%CONFIG_PATH%" -force -) else ( +) ELSE ( %IBCMD_TOOL% infobase config export --db-path="%IB_PATH%" "%CONFIG_PATH%" --force ) diff --git a/scripts/xml2cf.cmd b/scripts/xml2cf.cmd index fbe5e8f..779a145 100644 --- a/scripts/xml2cf.cmd +++ b/scripts/xml2cf.cmd @@ -7,59 +7,55 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set IB_PATH=%V8_TEMP%\tmp_db set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set CONFIG_FILE=%2 -if defined CONFIG_FILE ( +IF defined CONFIG_FILE ( set CONFIG_FILE=%CONFIG_FILE:"=% set CONFIG_FILE_PATH=%~dp2 ) set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:Designer XML format" exit /b 1 ) -if not defined CONFIG_FILE ( +IF not defined CONFIG_FILE ( echo Missed parameter 2 "path to 1C configuration file (*.cf)" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%CONFIG_FILE_PATH%" -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( echo Creating infobase "%IB_PATH%"... %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs echo Loading infobase "%IB_PATH%" configuration from XML-files "%CONFIG_PATH%"... %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /LoadConfigFromFiles %CONFIG_PATH% -) else ( +) ELSE ( echo Creating infobase "%IB_PATH%" from XML files "%CONFIG_PATH%"... %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%CONFIG_PATH%" ) echo Export infobase "%IB_PATH%" configuration to "%CONFIG_FILE%"... -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /DumpCfg %CONFIG_FILE% -) else ( +) ELSE ( %IBCMD_TOOL% infobase config save --db-path="%IB_PATH%" "%CONFIG_FILE%" ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" diff --git a/scripts/xml2edt.cmd b/scripts/xml2edt.cmd index 5ee2c7c..8ee42b4 100644 --- a/scripts/xml2edt.cmd +++ b/scripts/xml2edt.cmd @@ -4,45 +4,35 @@ rem Convert 1C configuration from 1C:Designer XML format to 1C:EDT format rem %1 - path to folder contains configuration files in 1C:Designer XML format rem %2 - path to folder to save configuration files in 1C:EDT format -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 -if not defined V8_TEMP set V8_TEMP=%TEMP%\1c +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c set IB_PATH=%V8_TEMP%\tmp_db set WS_PATH=%V8_TEMP%\edt_ws set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set EDT_PATH=%2 -if defined EDT_PATH set EDT_PATH=%EDT_PATH:"=% +IF defined EDT_PATH set EDT_PATH=%EDT_PATH:"=% -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:Designer XML format" exit /b 1 ) -if not defined EDT_PATH ( +IF not defined EDT_PATH ( echo Missed parameter 2 "path to folder to save configuration files in 1C:EDT format" exit /b 1 ) echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) -if exist "%EDT_PATH%" ( - rd /S /Q "%EDT_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" +IF exist "%EDT_PATH%" rd /S /Q "%EDT_PATH%" md "%EDT_PATH%" echo Export "%CONFIG_PATH%" to 1C:EDT format "%EDT_PATH%"... call %RING_TOOL% edt workspace import --project "%EDT_PATH%" --configuration-files "%CONFIG_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%" echo Clear temporary files... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) -if exist "%WS_PATH%" ( - rd /S /Q "%WS_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" +IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%" diff --git a/scripts/xml2ib.cmd b/scripts/xml2ib.cmd index 31b7b0d..661548c 100644 --- a/scripts/xml2ib.cmd +++ b/scripts/xml2ib.cmd @@ -7,41 +7,39 @@ rem %3 - convertion tool to use: rem ibcmd - ibcmd tool (default) rem designer - batch run of 1C:Designer -if not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe" set CONFIG_PATH=%1 -if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% +IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=% set IB_PATH=%2 -if defined IB_PATH set IB_PATH=%IB_PATH:"=% +IF defined IB_PATH set IB_PATH=%IB_PATH:"=% set CONV_TOOL=%3 -if defined CONV_TOOL ( +IF defined CONV_TOOL ( set CONV_TOOL=%CONV_TOOL:"=% -) else set CONV_TOOL=ibcmd +) ELSE set CONV_TOOL=ibcmd -if not defined CONFIG_PATH ( +IF not defined CONFIG_PATH ( echo Missed parameter 1 "path to folder contains configuration files in 1C:Designer XML format" exit /b 1 ) -if not defined IB_PATH ( +IF not defined IB_PATH ( echo Missed parameter 2 "path to folder contains 1C infobase" exit /b 1 ) echo Clear infobase folder "%IB_PATH%"... -if exist "%IB_PATH%" ( - rd /S /Q "%IB_PATH%" -) +IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" -if "%CONV_TOOL%" equ "designer" ( +IF "%CONV_TOOL%" equ "designer" ( echo Creating infobase "%IB_PATH%"... %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs echo Loading infobase "%IB_PATH%" configuration from XML-files "%CONFIG_PATH%"... %V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /LoadConfigFromFiles %CONFIG_PATH% -) else ( +) ELSE ( echo Creating infobase "%IB_PATH%" from XML files "%CONFIG_PATH%"... %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%CONFIG_PATH%" ) diff --git a/tests/test.cmd b/tests/test.cmd index 6320bb8..18063c3 100644 --- a/tests/test.cmd +++ b/tests/test.cmd @@ -13,9 +13,7 @@ set V8_VERSION=8.3.20.2290 set V8_TEMP=%OUT_PATH%\tmp echo Clear output files... -if exist "%OUT_PATH%" ( - rd /S /Q "%OUT_PATH%" -) +IF exist "%OUT_PATH%" rd /S /Q "%OUT_PATH%" md "%OUT_PATH%" md "%V8_TEMP%" @@ -45,9 +43,9 @@ echo ====== FOR /f %%f IN ('dir /b /a-d "%~dp0before\*.cmd"') DO ( set /a TEST_COUNT=!TEST_COUNT!+1 call %BEFORE_TEST_PATH%\%%~f - if exist "!TEST_CHECK_PATH!" ( + IF exist "!TEST_CHECK_PATH!" ( set /a TEST_SUCCESS=!TEST_SUCCESS!+1 - ) else ( + ) ELSE ( echo === echo Prepare step FAILED ^(%%~nf^): Path "!TEST_CHECK_PATH!" not found echo === @@ -64,9 +62,9 @@ echo ====== FOR /f %%f IN ('dir /b /a-d "%~dp0tests\*.cmd"') DO ( set /a TEST_COUNT=!TEST_COUNT!+1 call %TEST_PATH%\%%~f - if exist "!TEST_CHECK_PATH!" ( + IF exist "!TEST_CHECK_PATH!" ( set /a TEST_SUCCESS=!TEST_SUCCESS!+1 - ) else ( + ) ELSE ( echo === echo Test FAILED ^(%%~nf^): Path "!TEST_CHECK_PATH!" not found echo === @@ -89,4 +87,4 @@ FOR %%j IN (!TEST_FAILED_LIST!) DO ( echo %%j ) -rd /S /Q "%IB_PATH%" \ No newline at end of file +IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" \ No newline at end of file