2016-03-02 65 views
1

project.json文件可以包含prepublish条目,以在发布包之前执行一些脚本。有几个变量,这些脚本可用,根据自己wiki,例如%project:Directory%在ASP.NET5的预发布脚本中访问输出目录

"scripts": { 
    "prepublish": [ "dir %project:Directory%" ] 
} 

有什么办法来访问用于发布输入和输出目录?我在Visual Studio中看到实际的路径:

Publishing files to E:\Projects\WebPlatform\artifacts\bin\DemoLauncher\Release\PublishOutput 
Executing command ["C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:contentPath='C:\Users\xxxxx\AppData\Local\Temp\PublishTemp\DemoLauncher70\' -dest:contentPath='E:\Projects\WebPlatform\artifacts\bin\DemoLauncher\Release\PublishOutput' 

但是我似乎无法得到“prepublish”脚本中的值。我想是这样的:

"scripts": { 
    "prepublish": [ "dir %outputDirectory%" ] 
} 

回答

1

它转的指出,dnx/dnu发布命令不支持这一点,但是这些命令将与dotnet publish这将提供publish:OutputPath变量替换。

门票is available here及相关代码here