diff --git a/README.md b/README.md index b74dddd..d759a08 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/logaut/backends/lydia/_lydia_utils.py b/logaut/backends/lydia/_lydia_utils.py index cd84d0e..d282c0d 100644 --- a/logaut/backends/lydia/_lydia_utils.py +++ b/logaut/backends/lydia/_lydia_utils.py @@ -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 @@ -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()