Skip to content

Commit

Permalink
Fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoLuka committed Sep 12, 2023
1 parent 4b7b893 commit cfa3177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cliserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def app(environ: Dict[str, Any], start_response: StartResponse) -> Iterable[byte
return responder.respond(start_response, ResponseEnum.BadRequest, error_value, None)
else:
param_dict = dict()
commander = Commander(value["commands"], value["return_stdout"], len(value["params"]) > 0, param_dict)
commander = Commander(value["commands"], value["return_stdout"], len(value["params"]) > 0, param_dict,
value["variables"])
status, value = commander.execute_commands()
return responder.respond(start_response, status, value, None)

Expand Down
5 changes: 4 additions & 1 deletion example_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
"/hello": {
"method": "GET",
"params": ["message"],
"variables": {
"messages": "echo {message} | base64"
},
"commands": [
{
"condition": "{message} = hello",
"command": "echo {message}"
"command": "echo {messages}"
}
]
},
Expand Down

0 comments on commit cfa3177

Please sign in to comment.