1

The project.json file can contain a prepublish entry to execute some scripts before publishing of a package. There are several variables available in those scripts, according to their wiki, for example %project:Directory%

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

Is there any way to access the input and output directory used for publishing? I see in visual studio the actual paths:

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' 

However i cannot seem to get the values in "prepublish" script. I would like something like:

"scripts": {
  "prepublish": [ "dir %outputDirectory%" ]
}
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162

1 Answers1

1

It turn's out that dnx/dnu publish command doesn't support this, however the commands will be replaced with dotnet publish which will provide publish:OutputPath variable.

The ticket for is available here and relevant code here

Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162