Skip to content

Fix issue with stat format on Linux #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module/PowerShellEditorServices/Start-EditorServices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function Set-NamedPipeMode {
)
chmod $DEFAULT_USER_MODE $PipeFile
if ($IsLinux) {
$mode = stat -c "%A" $PipeFile
$mode = stat -c "%a" $PipeFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of my depth here but I assume we know that %A works on macOS? Also does the else below execute on Windows? Or maybe we don't call this function at all on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerl0706 almost certainly wrote and tested the script on macOS, so I'm assuming that works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stat -f "%a" on macOS gives me something totally different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stat -f "%A" gives me e.g. 700

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have sworn I tested on linux before shipping this... in any case, my bad and good find.

}
else {
$mode = stat -f "%A" $PipeFile
Expand Down