Skip to content
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

fix "stat: illegal option -- c" #28

Closed
wants to merge 1 commit into from
Closed

fix "stat: illegal option -- c" #28

wants to merge 1 commit into from

Conversation

zhangwei
Copy link

@reitzig

Hi, I am getting the issue with stat -c in MacOS 10.14.6.
stat -c does not work normally

stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]

See phpbrew/phpbrew#399

@reitzig
Copy link
Owner

reitzig commented Jul 30, 2019

It seems your commit would break it on Linux:

— ~ $ stat -c "%U" $SDKMAN_DIR
raphael
— ~ $ stat -f "%Su" $SDKMAN_DIR
stat: cannot read file system information for '%Su': No such file or directory
  File: "/home/raphael/.sdkman"
    ID: 721c61e23c37aed8 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 229681641  Free: 223090890  Available: 211406257
Inodes: Total: 58408960   Free: 58250721

There should be a red test, my bad...

@reitzig reitzig changed the base branch from master to dev July 30, 2019 20:24
@reitzig
Copy link
Owner

reitzig commented Jul 30, 2019

I added a test on dev; please rebase your PR on that branch. We should see a failing test then. If you can make it pass, I'll consider it.

FWIW, I started a branch to work towards macOS compatibility (cf. issue #29). Contributions welcome.

@zhangwei
Copy link
Author

zhangwei commented Aug 1, 2019

@reitzig
I rebased the PR. Does it seem that the test was passed?

BTW I noticed that you commit the commit 12f7d3d, and I think that should be a good solution for the issue.

@reitzig
Copy link
Owner

reitzig commented Aug 7, 2019

Thanks for your effort!

I see now that it won't be possible to write a failing test here: Fish simply can't separate "$owner != (whoami)" from "stat failed with an error", since both result in a non-zero exit code of test.

I'm closing this since a working fix exists on the upstream branch. Let's coordinate on #29 for getting sdk to macOS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants