我已经创建了一个.net核心应用程序。要安装它,我需要运行逗号:
dotnet restore
bower install
npm install
dotnet build
grunt在visual中,没有问题-安装和恢复逗号自动执行,grunt命令绑定到“构建后”绑定。
但是如果我想从命令行运行所有这些呢?有什么跨平台的脚本引擎我可以使用吗?或者我需要准备两个版本:用于运行上述命令的bash和powershell脚本?
一种方法是使用python --但不幸的是,必须首先安装运行时。dotnet对这个问题有什么解决办法吗?
发布于 2016-12-03 23:57:49
在project.json中,可以声明要在预编译/后期编译期间运行的脚本
https://learn.microsoft.com/pt-br/dotnet/articles/core/tools/project-json#scripts
所以你可以这样做:
{
    "scripts": {
        "precompile": ["npm install", "bower install"],
        "postcompile" : "grunt"
    }
}当您运行dotnet时,它将运行npm/bower,然后在构建之后,它将运行grunt。
https://stackoverflow.com/questions/40947121
复制相似问题