hyperion-start / hyperion-core

A Tmux based System Startup Engine
GNU General Public License v3.0
8 stars 3 forks source link

Source Custom Environment #19

Closed DavidPL1 closed 5 years ago

DavidPL1 commented 5 years ago

Similar to VDEMO provide a means to source an environment with custom variables and auxiliary functions.

Approach idea:

The reason to do this is that certain components need a specific environment for startup and checks. A tmux window sources the rc file of the current users standard shell, because it is an interactive shell. Still, for example if ros is used, currently sourcing the ros environment has to be included in a components cmd section or it has to be sourced by default in the rc file which would limit the default user environment to a single configuration at a time (and is obviously bad practice). Additionally commands called via subprocess are executed in a non-interactive shell thus no environment is sourced unless explicitly specified and no aliases or user defined functions are accessible.

DavidPL1 commented 5 years ago

Scratch the 'move scripts to base environment file' part: exporting functions as environment variables is a bash hack which is incompatible with other shells. Also always use the dot notation to source files in order to keep compatibility with the bourne shell.