簡體   English   中英

是否可以使用commands.json順序執行兩個命令?

[英]Is it possible to execute two commands sequentially using commands.json?

我正在使用Visual Studio 2017中的Mads Kristensen的Command Task Runner擴展程序,以在與同事的JS工作時提供幫助。 我已經建立了一個commands.json文件,該文件用於Lint和構建他的工作:

{
    "commands": {
        "chat-lint": {
            "fileName": "powershell.exe",
            "workingDirectory": "./Scripts/Chat",
            "arguments": "-Command yarn run lint:fix"
        },
        "chat-build": {
            "fileName": "powershell.exe",
            "workingDirectory": "./Scripts/Chat",
            "arguments": "-Command yarn run build"
        }
    },
    "-vs-binding": {
        "BeforeBuild": [],
        "AfterBuild": []
    }
}

我希望能夠在其中一個步驟中執行兩個命令:也就是說,在"chat-build"任務中執行yarn run build 之前執行yarn install 有可能嗎,或者我真的需要創建一個.ps1文件嗎? 如果我可以順序執行兩個命令,那就太好了。

當然,我可以在其中放置兩個Powershell命令,用分號分隔:“ arguments”:“ -command yarn install; yarn run build”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM