Skip to content

fix: remove pushd/popd from lib_std.sh import #656

@codeforester

Description

@codeforester

Summary

import changes directories with pushd / popd while sourcing a library. If the sourced file exits through exit_if_error or another early failure path, popd may never run and the shell directory stack can be polluted.

Action

  • Resolve relative imports against __SCRIPT_DIR__ without changing directories.
  • Keep absolute import behavior unchanged.
  • Add regression coverage for failed imports and relative imports.

Source

From the lib_std.sh Evolution Suggestions review item: "import uses pushd/popd, which is fragile under early exit."

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not workingtype:fix

    Projects

    Status
    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions