-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow chaining of workspaces #24
Conversation
Though it is not recommended to chain workspaces it might be desirable to source a workspace that us not the currently sourced one. With the changes introduced in version 0.5.0 this possibility was removed. This commit re-adds that functionality. The .cur_env file is always read independent of whether the ROB_FOLDERS_ACTIVE_ENV variable is set or not.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #24 +/- ##
==========================================
+ Coverage 45.84% 53.42% +7.58%
==========================================
Files 26 27 +1
Lines 1444 1458 +14
==========================================
+ Hits 662 779 +117
+ Misses 782 679 -103
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: David Oberacker <[email protected]>
Signed-off-by: David Oberacker <[email protected]>
Thank you @Oberacda! With the changes you provided, I think this is good to get merged. Edit: Thinking about this a bit more: This way, one could not alter the environment without robot_folders e.g. by manually sourcing a virtualenv or setting an installation path by hand. e.g. ### opening a new shell, current env is being cached away ###
ubuntu@jammy:~$ echo $PATH
/home/ubuntu/.node/bin:/home/ubuntu/.local/bin:/home/ubuntu/.node/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/ubuntu/.fzf/bin
ubuntu@jammy:~$ source .local/pipx/venvs/sphinx-autobuild/bin/activate
(sphinx-autobuild) ubuntu@jammy:~$ echo $PATH
/home/ubuntu/.local/pipx/venvs/sphinx-autobuild/bin:/home/ubuntu/.node/bin:/home/ubuntu/.local/bin:/home/ubuntu/.node/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/ubuntu/.fzf/bin
(sphinx-autobuild) ubuntu@jammy:~$ fzirob change_environment test_env
rob_folders change_environment test_env
Sourcing environment '/home/ubuntu/checkout/test_env'
Sourcing /opt/ros/rolling/setup.bash
Sourced colcon workspace /home/ubuntu/checkout/test_env/colcon_ws
Sourced misc_ws workspace from /home/ubuntu/checkout/test_env/misc_ws
Environment setup for 'test_env' done. You now have a sourced environment.
(test_env) ubuntu@jammy:~$ echo $PATH
/home/ubuntu/checkout/test_env/misc_ws/export/bin:/opt/ros/rolling/bin:/home/ubuntu/.local/bin:/home/ubuntu/.node/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/ubuntu/.fzf/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is helpful, but I would add some info to which state the environment is reset.
Though it is not recommended to chain workspaces it might be desirable to source a workspace that us not the currently sourced one. With the changes introduced in version 0.5.0 this possibility was removed. This commit re-adds that functionality. The .cur_env file is always read independent of whether the ROB_FOLDERS_ACTIVE_ENV variable is set or not.