JoshMcguigan / belay

Run your CI checks locally to `git push` with confidence
Apache License 2.0
41 stars 1 forks source link

Don't hardcode 'sh' / 'cmd' shells #4

Open nickolay opened 3 years ago

nickolay commented 3 years ago

Hey, thanks for making this tool, looks promising!

I wanted to try this on https://github.com/ballista-compute/sqlparser-rs on macOS and it failed with:

$ belay
Checking 'cargo fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')':
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `cargo fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')'
Error: "Failed"

I assume this is because belay runs commands with sh -c, while GitHub Actions use bash / powershell by default.

JoshMcguigan commented 3 years ago

Hi @nickolay, thanks for the report. Looks like github uses bash with a fallback to sh if bash is not available. I'd be open to a PR implementing this in belay! Bonus if it considers whatever the appropriate behavior for gitlab is.