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

use better portable shebang in scripts #82

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

Conversation

ttytm
Copy link

@ttytm ttytm commented Dec 12, 2024

Thanks for the work on this server.

I was running into a small issue of not being able to directly run the script due to bash not being in the path specified by the shebang.

The PR updates the shebang to make it more portable across systems and uses a uniform shell - atm. some scripts specify sh while others use bash.

@matatonic
Copy link
Owner

Thanks for this, but... What environment were you using that /usr/bin/env exists but /bin/sh or /bin/bash doesn't?

@ttytm
Copy link
Author

ttytm commented Dec 12, 2024

Thanks for this, but... What environment were you using that /usr/bin/env exists but /bin/sh or /bin/bash doesn't?

Thanks for tackling this @matatonic.

I'm using NixOS.

openedai-speech on  update-shebang [!?] via 🐍 v3.12.7 took 4m33s 
❯ which bash
/run/current-system/sw/bin/bash

openedai-speech on  update-shebang [!?] via 🐍 v3.12.7 
❯ which sh
/run/current-system/sw/bin/sh

BSD variants would be another destination that might not have #/bin/<shell> paths available.

As a reference an article that contains additional aspects regarding the portability of the shebang:
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html

@matatonic
Copy link
Owner

NixOS, nice! I'll update this in the next release, thanks again.

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.

2 participants