Skip to content
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

Windows support for Lydia docker #60

Merged
merged 4 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,18 @@ sudo chmod u+x lydia
sudo mv lydia /usr/local/bin/
```


This will install an alias to the inline Docker image execution
in your system PATH. Instead of `/usr/local/bin/`
you may use another path which is still in the `PATH` variable.

On Windows, make a `.bat` file:
```
docker run --name lydia -v"%cd%":/home/default whitemech/lydia lydia %*
```
And add it to your PATH variable.


## Quickstart

Now you are ready to go:
Expand Down
3 changes: 2 additions & 1 deletion logaut/backends/lydia/_lydia_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

"""This module contains utilities to call the Lydia tool from Python."""
import re
import sys
import subprocess
from typing import Match, cast

Expand All @@ -32,7 +33,7 @@

def call_lydia(*args) -> str:
"""Call the Lydia CLI tool with the arguments provided."""
command = ["lydia", *args]
command = ["lydia" if sys.platform != "win32" else "lydia.bat", *args]
try:
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = result.stdout.decode()
Expand Down