Skip to content

Commit 33dc3eb

Browse files
Added Alpine support
1 parent 69fb3dc commit 33dc3eb

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

browserstack/local_binary.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import platform, os, sys, zipfile, stat, tempfile, re, subprocess
1+
import platform, os, sys, stat, tempfile, re, subprocess
22
from browserstack.bserrors import BrowserStackLocalError
33

44
try:
@@ -14,10 +14,13 @@ def __init__(self):
1414
if osname == 'Darwin':
1515
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-darwin-x64"
1616
elif osname == 'Linux':
17-
if is_64bits:
18-
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-x64"
17+
if self.is_alpine():
18+
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-alpine"
1919
else:
20-
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-ia32"
20+
if is_64bits:
21+
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-x64"
22+
else:
23+
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-ia32"
2124
else:
2225
self.is_windows = True
2326
self.http_path = "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal.exe"
@@ -29,6 +32,12 @@ def __init__(self):
2932
]
3033
self.path_index = 0
3134

35+
def is_alpine(self):
36+
grepOutput = subprocess.run("gfrep -w NAME /etc/os-release", capture_output=True, shell=True)
37+
if grepOutput.stdout.decode('utf-8').find('Alpine') > -1:
38+
return True
39+
return False
40+
3241
def __make_path(self, dest_path):
3342
try:
3443
if not os.path.exists(dest_path):

0 commit comments

Comments
 (0)