Skip to content

Commit 741a64f

Browse files
committed
more logging
1 parent 78c456f commit 741a64f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

scripts/download-tools.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def download_heimdall(platform: str):
6060
logger.info("DONE.")
6161

6262

63-
def move_files_to_lib():
63+
def move_files_to_lib(platform: str):
6464
"""Move files to the expected path in the openandroidinstaller package."""
6565
target_path = Path(os.sep.join(["openandroidinstaller", "bin"]), exist_ok=True)
6666
logger.info(f"Move executables to {target_path}...")
@@ -75,6 +75,9 @@ def move_files_to_lib():
7575
.parent.joinpath(Path(os.sep.join(["..", "openandroidinstaller", "bin", "adb"])))
7676
.resolve()
7777
)
78+
if platform == "win32":
79+
adb_path = adb_path + ".exe"
80+
adb_target_path = adb_target_path + ".exe"
7881
logger.info(adb_target_path)
7982
adb_path.rename(adb_target_path)
8083
# move fastboot
@@ -88,6 +91,9 @@ def move_files_to_lib():
8891
.parent.joinpath(Path(os.sep.join(["..", "openandroidinstaller", "bin", "fastboot"])))
8992
.resolve()
9093
)
94+
if platform == "win32":
95+
fb_path = fb_path + ".exe"
96+
fb_target_path = fb_target_path + ".exe"
9197
fb_path.rename(fb_target_path)
9298
# move heimdall
9399
hd_path = Path(__file__).parent.joinpath(Path(os.sep.join(["..", "heimdall", "heimdall"]))).resolve()
@@ -96,6 +102,9 @@ def move_files_to_lib():
96102
.parent.joinpath(Path(os.sep.join(["..", "openandroidinstaller", "bin", "heimdall"])))
97103
.resolve()
98104
)
105+
if platform == "win32":
106+
hd_path = hd_path + ".exe"
107+
hd_target_path = hd_target_path + ".exe"
99108
hd_path.rename(hd_target_path)
100109
logger.info("DONE.")
101110
# make executable
@@ -107,10 +116,10 @@ def move_files_to_lib():
107116

108117

109118
def main(platform: str):
110-
logger.info(f"Run download for {platform}")
119+
logger.info(f"Run downloads for {platform} ...")
111120
download_adb_fastboot(platform=platform)
112121
download_heimdall(platform=platform)
113-
move_files_to_lib()
122+
move_files_to_lib(platform=platform)
114123

115124

116125
if __name__ == "__main__":

0 commit comments

Comments
 (0)