Skip to content

Add stdlib dependency guards to companion libraries #10

Description

@codeforester

Context

lib_file.sh and lib_git.sh depend on stdlib functions such as log_error, log_debug, fatal_error, and log_info_file. Their READMEs document the load order, but direct standalone sourcing fails later with rough command not found errors.

Scope

  • Add an early dependency guard to lib/bash/file/lib_file.sh.
  • Add an early dependency guard to lib/bash/git/lib_git.sh.
  • The guard should emit a concise message to stderr and return nonzero when the file is sourced without lib_std.sh.
  • Keep double-sourcing behavior intact.
  • Add BATS coverage for direct companion-library sourcing without stdlib.

Acceptance Criteria

  • Sourcing each companion library without stdlib returns nonzero with a clear message.
  • Sourcing after stdlib works as before.
  • Double-sourcing remains a no-op success.

Validation

  • ./tests/validate.sh

Suggested Branch

bug/<issue>-20260618-companion-dependency-guards

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions