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

Skip some environment definitions on source-sh #503

Closed
xdelaruelle opened this issue Jun 27, 2023 · 2 comments
Closed

Skip some environment definitions on source-sh #503

xdelaruelle opened this issue Jun 27, 2023 · 2 comments
Milestone

Comments

@xdelaruelle
Copy link
Collaborator

When sourcing a script into a modulefile with source-sh command it may be useful to skip some kind of definitions (among environment variables, shell alias, shell function, shell completion and directory change)

@bkatkam123
Copy link

I think, it's better to export functions only when they are marked for export with 'export -f function_name'. All internal functions may not be useful.

@xdelaruelle xdelaruelle added this to the 5.4.0 milestone Sep 8, 2023
@xdelaruelle
Copy link
Collaborator Author

I think, it's better to export functions only when they are marked for export with 'export -f function_name'. All internal functions may not be useful.

The idea of source-sh is to get the current environment defined as if shell script was sourced in current shell session. If internal functions are ignored, resulting environment will be different than if script was just sourced. I fear that something will get broken if non-exported function are ignored by source-sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants