99class LocalBinary :
1010 def __init__ (self ):
1111 is_64bits = sys .maxsize > 2 ** 32
12+ self .is_windows = False
1213 osname = platform .system ()
1314 if osname == 'Darwin' :
14- self .http_path = "https://s3.amazonaws.com/bs-automate-prod/ local/BrowserStackLocal-darwin-x64"
15+ self .http_path = "https://s3.amazonaws.com/browserStack/browserstack- local/BrowserStackLocal-darwin-x64"
1516 elif osname == 'Linux' :
1617 if is_64bits :
17- self .http_path = "https://s3.amazonaws.com/bs-automate-prod/ local/BrowserStackLocal-linux-x64"
18+ self .http_path = "https://s3.amazonaws.com/browserStack/browserstack- local/BrowserStackLocal-linux-x64"
1819 else :
19- self .http_path = "https://s3.amazonaws.com/bs-automate-prod/ local/BrowserStackLocal-linux-ia32"
20+ self .http_path = "https://s3.amazonaws.com/browserStack/browserstack- local/BrowserStackLocal-linux-ia32"
2021 else :
21- self .http_path = "https://s3.amazonaws.com/bs-automate-prod/local/BrowserStackLocal-win32.exe"
22+ self .is_windows = True
23+ self .http_path = "https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal.exe"
2224
2325 self .ordered_paths = [
2426 os .path .join (os .path .expanduser ('~' ), '.browserstack' ),
@@ -54,8 +56,11 @@ def download(self, chunk_size=8192, progress_hook=None):
5456 bytes_so_far = 0
5557
5658 dest_parent_dir = self .__available_dir ()
59+ dest_binary_name = 'BrowserStackLocal'
60+ if self .is_windows :
61+ dest_binary_name += '.exe'
5762
58- with open (os .path .join (dest_parent_dir , 'BrowserStackLocal' ), 'wb' ) as local_file :
63+ with open (os .path .join (dest_parent_dir , dest_binary_name ), 'wb' ) as local_file :
5964 while True :
6065 chunk = response .read (chunk_size )
6166 bytes_so_far += len (chunk )
@@ -71,7 +76,7 @@ def download(self, chunk_size=8192, progress_hook=None):
7176 except :
7277 return self .download (chunk_size , progress_hook )
7378
74- final_path = os .path .join (dest_parent_dir , 'BrowserStackLocal' )
79+ final_path = os .path .join (dest_parent_dir , dest_binary_name )
7580 st = os .stat (final_path )
7681 os .chmod (final_path , st .st_mode | stat .S_IXUSR )
7782 return final_path
0 commit comments