Skip to content

Commit 2bc7763

Browse files
committed
Fix unzip in powershell for paths that contain spaces
1 parent a0aceea commit 2bc7763

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

seleniumbase/console_scripts/sb_install.py

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,17 +1324,11 @@ def main(override=None, intel_for_uc=None, force_uc=None):
13241324
["unzip", zip_file_path, "-d", downloads_folder]
13251325
)
13261326
elif IS_WINDOWS:
1327-
subprocess.run(
1328-
[
1329-
"powershell",
1330-
"Expand-Archive",
1331-
"-Path",
1332-
zip_file_path,
1333-
"-DestinationPath",
1334-
downloads_folder,
1335-
"-Force",
1336-
]
1327+
cmd = (
1328+
f'Expand-Archive -Path "{zip_file_path}" '
1329+
f'-DestinationPath "{downloads_folder}" -Force'
13371330
)
1331+
subprocess.run(["powershell", "-Command", cmd])
13381332
else:
13391333
zip_ref.extractall(downloads_folder)
13401334
zip_ref.close()
@@ -1366,17 +1360,11 @@ def main(override=None, intel_for_uc=None, force_uc=None):
13661360
["unzip", zip_file_path, "-d", downloads_folder]
13671361
)
13681362
elif IS_WINDOWS:
1369-
subprocess.run(
1370-
[
1371-
"powershell",
1372-
"Expand-Archive",
1373-
"-Path",
1374-
zip_file_path,
1375-
"-DestinationPath",
1376-
downloads_folder,
1377-
"-Force",
1378-
]
1363+
cmd = (
1364+
f'Expand-Archive -Path "{zip_file_path}" '
1365+
f'-DestinationPath "{downloads_folder}" -Force'
13791366
)
1367+
subprocess.run(["powershell", "-Command", cmd])
13801368
else:
13811369
zip_ref.extractall(downloads_folder)
13821370
zip_ref.close()
@@ -1408,17 +1396,11 @@ def main(override=None, intel_for_uc=None, force_uc=None):
14081396
["unzip", zip_file_path, "-d", downloads_folder]
14091397
)
14101398
elif IS_WINDOWS:
1411-
subprocess.run(
1412-
[
1413-
"powershell",
1414-
"Expand-Archive",
1415-
"-Path",
1416-
zip_file_path,
1417-
"-DestinationPath",
1418-
downloads_folder,
1419-
"-Force",
1420-
]
1399+
cmd = (
1400+
f'Expand-Archive -Path "{zip_file_path}" '
1401+
f'-DestinationPath "{downloads_folder}" -Force'
14211402
)
1403+
subprocess.run(["powershell", "-Command", cmd])
14221404
else:
14231405
zip_ref.extractall(downloads_folder)
14241406
zip_ref.close()

0 commit comments

Comments
 (0)