Skip to content

Commit 0dbcc0a

Browse files
committed
Escape path-replacement regex for tools to work on windows
1 parent b7695ae commit 0dbcc0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openandroidinstaller/openandroidinstaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
from widgets import call_button, confirm_button, get_title, link_button
5757

5858
# Toggle to True for development purposes
59-
DEVELOPMENT = False
59+
DEVELOPMENT = True
6060
DEVELOPMENT_CONFIG = "yuga" # "a3y17lte" # "sargo"
6161

6262

openandroidinstaller/tool_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
def call_tool_with_command(command: str, bin_path: Path) -> bool:
2525
"""Call an executable with a specific command."""
26-
command = re.sub(r"^adb", str(bin_path.joinpath(Path("adb"))), command)
27-
command = re.sub(r"^fastboot", str(bin_path.joinpath(Path("fastboot"))), command)
28-
command = re.sub(r"^heimdall", str(bin_path.joinpath(Path("heimdall"))), command)
26+
command = re.sub(r"^adb", re.escape(str(bin_path.joinpath(Path("adb")))), command)
27+
command = re.sub(r"^fastboot", re.escape(str(bin_path.joinpath(Path("fastboot")))), command)
28+
command = re.sub(r"^heimdall", re.escape(str(bin_path.joinpath(Path("heimdall")))), command)
2929

3030
logger.info(f"Run command: {command}")
3131
res = call(f"{command}", shell=True)

0 commit comments

Comments
 (0)