J.U.S.T. Wrap

Just_wrap

Wrap file to create just environment

Usage

There are a total of four ways to use this wrap script.

  • Calling a command in your project environment. e.g.: “./wrap ls”

  • exec-ing a command in your project environment. This correctly results in no child processes. The exception to this is when you use built in bash commands (i.e. declare), in which case the child is not exec-ed. For example: “exec ./wrap ls”

  • Sourcing your environment into your current environment. e.g.: “. ./wrap”

  • Start a new bash shell session and load the project environment into the new session. For example: “./wrap” with no arguments.

Parameters:

[JUST_WRAP_NO_PS1] - When running a new bash shell, PS1 is exported to include (just) in it to let you know you are in the shell. To disable this behavior, set JUST_WRAP_NO_PS1 to 1.

Default:

0

Example

If you have a ./wrap script in your main project repository, and for example, have the vsi_common submodule checked out in ./external/vsi_common, your wrap script would look something like this:

#!/usr/bin/env bash
source "$(dirname "${BASH_SOURCE[0]}")/external/vsi_common/linux/just_files/Just_wrap" "${BASH_SOURCE[0]}" my_project.env ${@+"${@}"}

where my_project.env is the main project settings file.

Note

Sourcing Just_wrap from a script will ALWAYS appear as if Just_wrap is being wrapped, and it will react as such. Use just_env to load only the just project environment

See also

just_env