2017-09-05 99 views
0

是否可以從VSCode中的任務運行任務?VScode中的任務

例JSON:

{ 
// See https://go.microsoft.com/fwlink/?LinkId=733558 
// for the documentation about the tasks.json format 
"version": "2.0.0", 
"tasks": [ 
    { 
     "taskName": "Show In Chrome", 
     "windows": { 
      "command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" 
     }, 
     "osx": { 
      "command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" 
     }, 
     "args": [ 
      "${file}" 
     ], 
     "type": "process", 
    }, 
    { 
     "taskName": "Show Coverage", 
     // this is the task to call another task 
    } 
] 

}

我想要做的是有顯示覆蓋任務,尋找在覆蓋文件夾中的文件,然後撥打顯示在Chrome的任務,它顯示爲該文件的參數被傳遞。這可能嗎?

+0

我不明白這個評論。 – KeniSteward

回答

0

事實證明,文檔網站的當前配置不會更新任務。

但是,如果你想有一個任務來調用其他的任務,因爲它依賴於他們,你可以簡單地添加該配置

{ 
// See https://go.microsoft.com/fwlink/?LinkId=733558 
// for the documentation about the tasks.json format 
"version": "2.0.0", 
"tasks": [ 
    { 
     "taskName": "Show In Chrome", 
     "identifier": "showInChrome", 
     "windows": { 
      "command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" 
     }, 
     "osx": { 
      "command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" 
     }, 
     "args": [ 
      "${file}" 
     ], 
     "type": "process", 
    }, 
    { 
     "taskName": "Show Coverage", 
     "dependsOn": "showInChrome" 
    } 
] 
} 

這將導致任務運行的前一個任務,然後運行任何命令,它已成立以及。

注意:您可以使用多個依賴通過使用一個標識符數組。

相關問題