Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

use better portable shebang in scripts#82

Open
ttytm wants to merge 1 commit intomatatonic:mainfrom
ttytm:update-shebang
Open

use better portable shebang in scripts#82
ttytm wants to merge 1 commit intomatatonic:mainfrom
ttytm:update-shebang

Conversation

@ttytm
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants