批处理脚本在第一个 asciidoctor 命令完成后意外返回

问题描述 投票:0回答:1

我刚刚创建了一个批处理文件来在 inno setup 中的 asciidoctor 和安装程序中构建文档。
我注意到对 asciidoctor 命令的调用会导致脚本立即返回。对 iscc 的调用允许调用后续命令(我正在打乱顺序以查找原因)。 asciidoctor 调用应该获取一些额外的参数吗?

@echo off
setlocal
set "SolutionDir=%1"
echo POST-BUILD
set "filePath=%SolutionDir%SlitapScheduler\bin\Release\SlitapScheduler.exe"
echo %filePath%
set "filePath=%filePath:\=\\%"

for /f "usebackq delims=" %%a in (`wmic DATAFILE WHERE "name='%filePath%'" get Version /format:Textvaluelist`) do (
    for /f "delims=" %%# in ("%%a") do set "%%#"
)

echo %Version%

asciidoctor -V 
REM below this line commands are not executed

echo :::HTML generation:::
asciidoctor -v -t -a release-version=%Version% "%SolutionDir%Docs\SlitapScheduler.adoc"

echo :::PDF generation:::
asciidoctor-pdf -v -t -a release-version=%Version% "%SolutionDir%Docs\SlitapScheduler.adoc"

echo :::SETUP generation:::
iscc /O+ "%SolutionDir%Setup\neu_inno_script.iss"


endlocal
C:\project\SlitapScheduler\Setup>a C:\project\SlitapScheduler\
POST-BUILD
C:\project\SlitapScheduler\SlitapScheduler\bin\Release\SlitapScheduler.exe
1.0.0.16
Asciidoctor 2.0.20 [https://asciidoctor.org]
Runtime Environment (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]) (lc:IBM437 fs:UTF-8 in:UTF-8 ex:UTF-8)
batch-file command-line-interface asciidoctor
1个回答
0
投票

事实证明,在 asciidoctor 命令帮助之前调用,并且所有命令都已运行

© www.soinside.com 2019 - 2024. All rights reserved.