File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,25 @@ elseif($IsMacOS){
88 $AssembliesPath = " $PSScriptRoot /assemblies/macos"
99}
1010
11+ # Grant Execution permission to assemblies on Linux and MacOS
12+ if ($IsLinux -or $IsMacOS ){
13+ # Check if powershell is NOT running as root
14+ $AssemblieFiles = Get-ChildItem - Path $AssembliesPath | Where-Object {$_.Name -eq ' chromedriver' -or $_.Name -eq ' geckodriver' }
15+ foreach ($AssemblieFile in $AssemblieFiles ){
16+ if ($IsLinux ){
17+ $FileMod = stat - c " %a" $AssemblieFile.fullname
18+ }
19+ elseif ($IsMacOS ){
20+ $FileMod = / usr/ bin/ stat -f " %A" $AssemblieFile.fullname
21+ }
22+
23+ if ($FileMod [2 ] -ne ' 5' -and $FileMod [2 ] -ne ' 7' ){
24+ Write-Host " Granting $ ( $AssemblieFile.fullname ) Execution Permissions ..."
25+ chmod + x $AssemblieFile.fullname
26+ }
27+ }
28+ }
29+
1130function Start-SeChrome {
1231 Param (
1332 [Parameter (Mandatory = $false )]
You can’t perform that action at this time.
0 commit comments