json文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"version": "2.0.0",
"options": {
"cwd": "${fileDirname}/build"
},
"tasks": [
{
"type": "shell",
"label": "cmake",
"command": "cmake",
"args": [
".."
]
},
{
"label": "make",
"group": {
"kind": "build",
"isDefault": "true"
},
"command": "make -j12",
"args": [

]
},
{
"label": "Build",
"dependsOn":[
"cmake",
"make"
]
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"version": "2.0.0",
"inputs": [
{
"type": "promptString",
"id": "commitInfo",
"description": "输入commit信息",
"default": "default information"
}
],
"tasks": [
{
"label": "提交代码",
"type": "shell",
"command": "./push.sh",
"args": [
"${input:commitInfo}"//inputs中的id
],
"group": "test",
"presentation": {
},
"problemMatcher": []
}
]
}

shell脚本

1
2
3
4
5
#!/bin/bash

git add .
git commit -am $1
git push