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