Skip to content

Commit eecfe02

Browse files
authored
Fix issue with stat format on Linux (#698)
* Fix issue with stat format on Linux * Improve macOS differentiation
1 parent f675744 commit eecfe02

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,20 @@ function Set-NamedPipeMode {
222222
[string]
223223
$PipeFile
224224
)
225+
226+
if ($IsWindows) {
227+
return
228+
}
229+
225230
chmod $DEFAULT_USER_MODE $PipeFile
231+
226232
if ($IsLinux) {
227-
$mode = stat -c "%A" $PipeFile
233+
$mode = stat -c "%a" $PipeFile
228234
}
229-
else {
235+
elseif ($IsMacOS) {
230236
$mode = stat -f "%A" $PipeFile
231237
}
238+
232239
if ($mode -ne $DEFAULT_USER_MODE) {
233240
ExitWithError "Permissions to the pipe file were not set properly. Expected: $DEFAULT_USER_MODE Actual: $mode for file: $PipeFile"
234241
}

0 commit comments

Comments
 (0)