1

project.json文件可以包含prepublish在发布包之前执行某些脚本的条目。例如,根据他们的wiki ,这些脚本中有几个可用的变量%project:Directory%

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

有没有办法访问用于发布的输入和输出目录?我在视觉工作室看到了实际路径:

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' 

但是我似乎无法获得“预发布”脚本中的值。我想要类似的东西:

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

1 回答 1

1

事实证明,dnx/dnu发布命令不支持这一点,但是这些命令将被替换dotnet publish为提供publish:OutputPath变量的命令。

门票可在此处获得,相关代码可在此处获得

于 2016-03-02T21:03:13.217 回答