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

Better shfmt CLI path lookup #2035

Closed
Goooler opened this issue Feb 6, 2024 · 3 comments · Fixed by #2050
Closed

Better shfmt CLI path lookup #2035

Goooler opened this issue Feb 6, 2024 · 3 comments · Fixed by #2050

Comments

@Goooler
Copy link
Member

Goooler commented Feb 6, 2024

If I install shfmt via Go following the official instruction, it cannot be detected by Spotless automatically, may need to handle this case. See

@tcrawford-figure
Copy link
Contributor

Based on what I see on macOS, shfmt is not immediately made accessible on the PATH. For mac, I would have to add ~/go/bin to my PATH in order to get this to work since that's where go installs binaries on mac. I'm sure something similar is necessary for ubuntu and that the ubuntu github runners don't have the go bin path on the PATH by default.

@Goooler
Copy link
Member Author

Goooler commented Feb 8, 2024

Yeah, $GOPATH/bin hasn't been added to path, I filed it to actions/runner-images#9316.

But the issue still exists, I installed it via apt, cannot be detected as well, see https://github.com/Goooler/spotless/actions/runs/7827663325/job/21356021181

@tcrawford-figure
Copy link
Contributor

That's interesting that apt didn't work for you. Did you specifically use apt or apt-get? One of the reasons I decided not to use apt or apt-get was that it installs an older version of shfmt: 3.6.0. The latest is 3.7.0.

In the issue that you filed it seems like the recommendation is to use https://github.com/actions/setup-go. I wonder if that's the preferred route we should take here instead of installing shfmt from the published github release.

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

Successfully merging a pull request may close this issue.

2 participants