该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%" ]
}