Add which.
This commit is contained in:
parent
415a183d79
commit
4d8571556a
1 changed files with 7 additions and 0 deletions
|
@ -118,3 +118,10 @@ def run_with_tee(session: Session, args: List[str], **kwargs):
|
||||||
|
|
||||||
def get_user(session):
|
def get_user(session):
|
||||||
return session.check_output(["echo", "$USER"], cwd="/").decode().strip()
|
return session.check_output(["echo", "$USER"], cwd="/").decode().strip()
|
||||||
|
|
||||||
|
|
||||||
|
def which(session, name):
|
||||||
|
ret = session.check_output(["which", name], cwd="/").decode().strip()
|
||||||
|
if not ret:
|
||||||
|
return None
|
||||||
|
return ret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue