Skip to content

feat: Add shell options to run commands #965

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NavyD
Copy link

@NavyD NavyD commented Mar 1, 2025

Closes #953

⚡ Summary

Add the shell []string option to the jobs/commands hook to run the command to provide consistency for Windows and Unix, and the default is empty will not cause compatibility issues.

pre-commit:
  jobs:
    - name: test
      shell:
        - powershell
        - -Command
      run: |
        echo test
        $PSVersionTable

Note: This is just a simple implementation, any suggestions for improvement are welcome, I'm not very familiar with golang, so I hope this doesn't bother you!

☑️ Checklist

  • Check locally
  • Add tests
  • Add documentation

@NavyD NavyD marked this pull request as ready for review March 15, 2025 08:46
@mrexox
Copy link
Member

mrexox commented Mar 26, 2025

Hey! Thank you for creating this PR. I pretty like this option but I could resolve the issue without adding the additional configuration options.

I think to take a pause and revisit this idea, maybe when I found a new issue this change can fix I will finish this PR.

@NavyD
Copy link
Author

NavyD commented Mar 26, 2025

Thank you for your reply!

I created this PR for a better windows experience, to be able to run some simple commands directly instead of creating script files to execute them! Fixing this issue is just by the way, you can ignore or close this PR!

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.

Wrap commands in Git bash on Windows
2 participants