2016-03-02 62 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