- Display the paths that are on the PATH and PYTHONPATH in a more readable format.
- Check whether a path is on the PATH or PYTHON.
- Delete a path from the PATH or PYTHONPATH.
- Add a path from the PATH or PYTHONPATH.
- Move a path to a different position in the PATH or PYTHONPATH.
-
Clone the repository to your user home directory and cd into the
.pathmod
folder.git clone https://github.com/rickstaa/.pathmod.git cd .pathmod
-
Run the
install.sh
script to install the ROS Conda wrapper.
-
Create a symbolic link to the
.pathmod_rc
file:ln -fs "$(pwd)/.pathmod_rc" "$(echo $HOME)/.pathmod_rc"
-
Add the following code at the end of your
.bashrc
.# >>> pathmod initialize >> ## Source pathmod script if [ -f "$HOME/.pathmod_rc" ]; then . "$HOME/.pathmod_rc" fi # <<< pathmod initialize <<<
To uninstall the pathmod script run the uninstall.sh
script before removing the .pathmod
repository.
The pathmod script takes the following commands:
-a --add
: Add path(s) to the PATH or PYTHONPATH-i --index:
Specify the index where to add the path(s) (OPTIONAL: 0=start, -1=end, defaults to -1)-m --move
: Move a path to a given index (Adds path if not yet present.)-r --remove
: Remove path(s) from the PATH or PYTHONPATH-c --check
: Check if path exists in the PATH or PYTHONPATH-h --help
: Display help-p --pythonpath
: Modify PYTHONPATH instead of PATH-v, --version
: Show pathmod version-s --settings
: List pathmod settings and the current PATH and PYTHONPATH-sd --set-path-display
: Display PATH and PYTHONPATH after each command (OPTIONAL, defaults to false)-se --set-export
: Export path after it is set (OPTIONAL, defaults to true)-sg --set-path-guard
: Check whether a path is valid before adding it (OPTIONAL, defaults to false)
ℹ️ NOTE: Each option only accepts one argument at the same time. To add, remove or check multiple
paths please use the colon (Example: pathmod --<OPTION> <PATH1>:<PATH2>
) or space separator (Example: pathmod --<OPTION> "<PATH1> <PATH2>"
).
pathmod --add <PATH>
pathmod --add <PATH> --index <INDEX>
pathmod --remove <PATH>
pathmod --remove <INDEX>
pathmod --exists <PATH>
pathmod --move <PATH> --index <INDEX>
pathmod --move <OLD_INDEX> --index <NEW_INDEX>
pathmod --pythonpath --add <PATH>
Please feel free to open an issue if you run into problems or have suggestions.
Feel free to open an issue if you have ideas on how to make this GitHub action better or if you want to report a bug! All contributions are welcome. 🚀 Please consult the contribution guidelines for more information.