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

lib.sh,hijack.sh: restore ability to be sourced interactively #1071

Closed
wants to merge 2 commits into from

Commits on Jun 29, 2023

  1. logging_ctl.sh: basename -- "$SCRIPT_NAME"

    $SCRIPT_NAME is `-bash` when sourcing `lib.sh` directly from an
    interactive shell.
    
    Fixes this error in that case:
    ```
    basename: invalid option -- 'b'
    Try 'basename --help' for more information.
    ```
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    4a16be9 View commit details
    Browse the repository at this point in the history
  2. lib.sh,hijack.sh: restore ability to be sourced interactively

    Run start_test() and func_exit_handler() only in "normal" usage, not
    when sourced interactively (for interactive debug) and not as a subtest.
    
    With this commit it's not possible to do this without any side-effect:
    
    ```
    ( source case-lib/lib.sh )
    ```
    
    More to the point, it's now possible to run this and start interactive
    testing without any unwanted actions:
    
    ```
    source case-lib/lib.sh
    get_firmware_path
    ```
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    e70bf2b View commit details
    Browse the repository at this point in the history