Skip to content

Commit 660bae3

Browse files
Merge pull request #1 from SpotDraft/fix-typos
Fix typos
2 parents 2e51942 + b53bcd7 commit 660bae3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/python_redlines/engines.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import platform
55
import zipfile
6+
import tarfile
67
from pathlib import Path
78
from typing import Union, Tuple, Optional
89

@@ -28,25 +29,24 @@ def _unzip_binary(self):
2829
arch = 'x64' # Assuming x64 architecture
2930

3031
if os_name == 'linux':
31-
zip_name = f"linux-{arch}-{__version__}.zip"
32-
binary_name = 'linux-64/redlines'
32+
zip_name = f"linux-{arch}-{__version__}.tar.gz"
33+
binary_name = 'linux-x64/redlines'
34+
zip_path = os.path.join(binaries_path, zip_name)
35+
if not os.path.exists(zip_path):
36+
with tarfile.open(zip_path, 'r:gz') as tar_ref:
37+
tar_ref.extractall(target_path)
3338

3439
elif os_name == 'windows':
3540
zip_name = f"win-{arch}-{__version__}.zip"
3641
binary_name = 'win-x64/redlines.exe'
42+
zip_path = os.path.join(binaries_path, zip_name)
43+
if not os.path.exists(zip_path):
44+
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
45+
zip_ref.extractall(target_path)
3746

3847
else:
3948
raise EnvironmentError("Unsupported OS")
4049

41-
full_binary_path = os.path.join(target_path, binary_name)
42-
43-
if not os.path.exists(full_binary_path):
44-
45-
zip_path = os.path.join(binaries_path, zip_name)
46-
47-
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
48-
zip_ref.extractall(target_path)
49-
5050
return os.path.join(target_path, binary_name)
5151

5252
def run_redline(self, author_tag: str, original: Union[bytes, Path], modified: Union[bytes, Path]) \

0 commit comments

Comments
 (0)