我如何配置 launch.json 以便它可以键入自动响应?
How can I configure launch.json so it could type automatic response?
'python manage.py collectstatic' 几乎总是需要键入 'yes' 或 'no'(preLaunchTask(collecstatic) output),然后才能继续执行。我可以让它在 .json 文件中自动发送 'yes' 吗?
launch.json
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask" : "collectstaticcommand",
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}\manage.py",
"args": [
"runserver"
],
"django": true,
"justMyCode": false
},
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "collectstaticcommand",
"type": "shell",
"command": "python",
"args" : [
"manage.py",
"collectstatic"
]
}
]
}
问题通过在tasks.json
中的“args”中添加'--noinput'来解决:[]
'python manage.py collectstatic' 几乎总是需要键入 'yes' 或 'no'(preLaunchTask(collecstatic) output),然后才能继续执行。我可以让它在 .json 文件中自动发送 'yes' 吗? launch.json
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask" : "collectstaticcommand",
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}\manage.py",
"args": [
"runserver"
],
"django": true,
"justMyCode": false
},
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "collectstaticcommand",
"type": "shell",
"command": "python",
"args" : [
"manage.py",
"collectstatic"
]
}
]
}
问题通过在tasks.json
中的“args”中添加'--noinput'来解决:[]