auto-source ROS setup.bash
This plugin is for ROS, so it has no effect if you don't use ROS.
- Bass plugin (for sourcing the setup.bash file)
fisher install kenji-miyake/auto-source-setup-bash.fish
git clone [email protected]:kenji-miyake/auto-source-setup-bash.fish.git
cd auto-source-setup-bash.fish
./install
This plugin is automatically executed when:
- you open a new terminal and current directory is your workspace
- you move to your workspace
In other words, this adds hooks to functions fish_greeting
and cd
.
If you'd like to disable auto-source, call auto_source_disable
or set DISABLE_AUTO_SOURCE
.
auto_source_disable
# or
set -U DISABLE_AUTO_SOURCE
To re-enable,
auto_source_enable
# or
set -e DISABLE_AUTO_SOURCE
By default, This plugin load the previous-loaded setup.bash when you are at home directory.
To disable this feature,
set -U AUTO_SOURCE_USE_PREV_SETUP_BASH false
To re-enable,
set -U AUTO_SOURCE_USE_PREV_SETUP_BASH true
To just clear cache,
auto_source_clear_cache
# or
set -e AUTO_SOURCE_PREV_SETUP_BASH
source /path/to/setup.bash
~/path_to_your_catkin_workspace
❯
~
❯ cd path_to_your_colcon_workspace
source /path/to/setup.bash
If you'd like to customize the command executed before/after source setup.bash
, please set AUTO_SOURCE_BEFORE_SOURCE_COMMAND
and AUTO_SOURCE_AFTER_SOURCE_COMMAND
.
Default:
AUTO_SOURCE_BEFORE_SOURCE_COMMAND
='echo "source $setup_bash" && set -g AUTO_SOURCE_PREV_ROS_DISTRO $ROS_DISTRO'
AUTO_SOURCE_AFTER_SOURCE_COMMAND
=''
source /path/to/setup.bash
~
❯ echo $AUTO_SOURCE_PREV_ROS_DISTRO
foxy
After set -U AUTO_SOURCE_AFTER_SOURCE_COMMAND 'echo $ROS_DISTRO > ~/.auto-source'
:
source /path/to/setup.bash
~
❯ cat ~/.auto-source
foxy