|
@@ -18,9 +18,11 @@ def exe_str_cmd():
|
|
req_json = request.json
|
|
req_json = request.json
|
|
client = get_client(req_json)
|
|
client = get_client(req_json)
|
|
# 转换执行字符串
|
|
# 转换执行字符串
|
|
- exec_str = "&&".join(list(filter(lambda x: not str.startswith(x, "#"),
|
|
|
|
- (req_json.get('exec_str_before') + '\n' + req_json.get(
|
|
|
|
- 'exec_str')).splitlines())))
|
|
|
|
|
|
+ before_str = req_json.get('exec_str_before')
|
|
|
|
+ exec_str = req_json.get('exec_str')
|
|
|
|
+ if before_str is not None and len(before_str) > 1:
|
|
|
|
+ exec_str = before_str + '\n' + exec_str
|
|
|
|
+ exec_str = " && ".join(list(filter(lambda x: not str.startswith(x, "#"), exec_str.splitlines())))
|
|
result_str = run_cmd(client, exec_str)
|
|
result_str = run_cmd(client, exec_str)
|
|
client.close()
|
|
client.close()
|
|
return result_str
|
|
return result_str
|