You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skip some environment definitions on source-sh #503
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)
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.
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.
Activity
bkatkam123 commentedon Jun 27, 2023
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 commentedon Feb 10, 2024
The idea of
source-shis 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 bysource-sh.Add --ignore option to source-sh modulefile cmd