-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print warning and resolve to absolute path for commands specified with relative path #320
base: master
Are you sure you want to change the base?
Conversation
lib/vsc/utils/run.py
Outdated
@@ -87,6 +87,38 @@ | |||
SHELL = BASH | |||
|
|||
|
|||
def ensure_cmd_abs_path(cmd): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow to pass path
to which
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 919b9ec
lib/vsc/utils/run.py
Outdated
@@ -172,7 +204,7 @@ def __init__(self, cmd=None, **kwargs): | |||
if not hasattr(self, 'log'): | |||
self.log = getLogger(self._get_log_name()) | |||
|
|||
self.cmd = cmd # actual command | |||
self.cmd = ensure_cmd_abs_path(cmd) # actual command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow path as kwargs (call it command_path to avoid any conflict with other)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 919b9ec
Tests fail on:
That's a special case I haven't taken into account yet, indeed: the command to run is not necessarily the first string value, there may be environment stuff in front of it... Oh boy. @stdweird Any suggestions come to mind on how to handle this edge case? |
Split on |
@boegel solution is to only set absolute path when no shell is being used. in a shell, the shell will do this anyway |
@boegel is this still needed? tbh, now we went py3 only I would suggest using pathlib |
No description provided.