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

Failure to resolve sh -c bash #87

Open
arogozhnikov opened this issue Apr 21, 2024 · 1 comment
Open

Failure to resolve sh -c bash #87

arogozhnikov opened this issue Apr 21, 2024 · 1 comment

Comments

@arogozhnikov
Copy link

Let me start from goal. I want to run typer --install-completions in container, I want this to be run automatically.

Sadly, this means command should run from sh. Usually no big deal as sh -c 'bash -lc do-whatever'. But typer uses shellingham to auto-identify shell.

And here we are (whole thing running from bash):

># python -c "import shellingham; print(shellingham.detect_shell())"
('bash', '/bin/bash') 
># sh -c 'python -c "import shellingham; print(shellingham.detect_shell())"'
('sh', 'sh')
># bash -c 'python -c "import shellingham; print(shellingham.detect_shell())"'
('bash', '/bin/bash')
># sh
># bash -c 'python -c "import shellingham; print(shellingham.detect_shell())"'
('sh', 'sh')  # WHYYY?

and I don't see a way to affect this or override it somehow - a single sh in chain, and shellingham says it is sh. Correspondingly typer won't install any completions.

@uranusjr
Copy link
Member

I wonder if this is the same as #86. Some local debugging work would help a lot here.

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

No branches or pull requests

2 participants