project.json
文件可以包含prepublish
条目,以便在发布包之前执行某些脚本。根据他们的wiki,这些脚本中有几个变量,例如%project:Directory%
"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%" ]
}
答案 0 :(得分:1)
我们发现public class Question implements Parcelable {
private final String mQuestion;
private final List<String> mAnswers;
private final int mCorrectAnswer;
public Question(final String question, final List<String> answers, int correctAnswer) {
mQuestion = question;
mAnswers = answers;
mCorrectAnswer = correctAnswer;
}
// implement parcelable interface below
}
发布命令不支持此操作,但命令将替换为dnx/dnu
,这将提供dotnet publish
变量。
is available here和相关代码here的票证