Skip to content

Skip some environment definitions on source-sh #503

Closed

Description

@xdelaruelle

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)

Activity

  1. bkatkam123 commented on Jun 27, 2023

    @bkatkam123

    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.

  2. added this to the 5.4.0 milestone on Sep 8, 2023
  3. xdelaruelle commented on Feb 10, 2024

    @xdelaruelle
    CollaboratorAuthor

    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.

  4. added a commit that references this issue on Feb 16, 2024
    6755b18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions