workspace: fix xterm cmdargs (asyncssh create_process single command)
This commit is contained in:
parent
67f318888d
commit
9f4307b5d9
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
|
|
||||||
file_id = (params_kw or {}).get('id', '').strip()
|
file_id = (params_kw or {}).get('id', '').strip()
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ if not file_id or not ws_dir:
|
|||||||
r = DictObject()
|
r = DictObject()
|
||||||
r.host = 'localhost'
|
r.host = 'localhost'
|
||||||
r.username = 'pipeline'
|
r.username = 'pipeline'
|
||||||
r.cmdargs = ['echo', '未指定文件']
|
r.cmdargs = ['echo 未指定文件']
|
||||||
return r
|
return r
|
||||||
|
|
||||||
full_path = ws_dir + '/' + file_id
|
full_path = ws_dir + '/' + file_id
|
||||||
@ -41,11 +42,11 @@ if not real_full.startswith(real_ws + os.sep):
|
|||||||
r = DictObject()
|
r = DictObject()
|
||||||
r.host = 'localhost'
|
r.host = 'localhost'
|
||||||
r.username = 'pipeline'
|
r.username = 'pipeline'
|
||||||
r.cmdargs = ['echo', '非法路径']
|
r.cmdargs = ['echo 非法路径']
|
||||||
return r
|
return r
|
||||||
|
|
||||||
r = DictObject()
|
r = DictObject()
|
||||||
r.host = 'localhost'
|
r.host = 'localhost'
|
||||||
r.username = 'pipeline'
|
r.username = 'pipeline'
|
||||||
r.cmdargs = ['vi', full_path]
|
r.cmdargs = ['vi ' + shlex.quote(full_path)]
|
||||||
return r
|
return r
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user