Improve how trogon is calling the command with arguments #107
+32
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to resolve several problems. All the changes are small and connected, that is why I opened just one PR.
Please review it commit by commit.
Fixes:
#104 - In
run_command.py
file theUserCommandData.to_cli_args()
now contains string conversion.I have not added conversion to
_to_cli_args()
as it was already too complex.#105 -
shlex
replaced tooslex
, for the need of Windows users.I have added to
pyproject.toml
.TODO:
poetry.lock
was not updated, I don't have tooling for that.#106 - To run well and wait for the output on Windows I have added
sys.exit(subprocess.call(..., shell=True))
as the pair ofos.execvp()
call.Note:
shell=True
was needed for me.#81 , #70 , #67 , #65 - I try to fix all these. In the file
detect_run_string.py
the functiondetect_run_string()
returns a short version of the command, while for execution we need the full version. So I have added a functionexact_run_commands()
. I have also modified how the command is called introgon.py
and replacedos.execvp()
toos.execv()
.Tested:
-m
, outside of a venv with direct path to Python.exe, and with installed app-m
, outside of a venv with direct path to python3I have not tested with pipx or such cases. Please tell me of more modification is needed.