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

Fish sourcing uses exit instead of return #16

Open
hpfr opened this issue Jul 7, 2021 · 0 comments
Open

Fish sourcing uses exit instead of return #16

hpfr opened this issue Jul 7, 2021 · 0 comments

Comments

@hpfr
Copy link

hpfr commented Jul 7, 2021

Hi, thanks for your work on this project!

One potential issue I noticed: Fish complains about areturn from non-function in a translated file containing environment variables that was intended to be sourced by Bash. In Bash return is used for returning from functions and from files being sourced, but in Fish, exit is used. We can't change from return to exit in the sourced Bash file because it exits the shell that's sourcing, unlike fish.

Since source statements are translated by inserting calls to babelfish, maybe a -source option could be introduced indicating the Bash input should have top-level returns converted to exits? Then source statements could be translated by inserting calls to babelfish -source?

What do you think? Thanks!

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

1 participant