Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: source files using absolute paths for absolute BASH_SOURCE
Some completion functions use BASH_SOURCE to identify the path to the file where the functions are defined. However, if the file was sourced with the relative path (e.g. `. ./completions/make`), BASH_SOURCE referenced by the function contains the relative path. This causes the problem after the current working directory is changed from the one where the file was sourced. To make BASH_SOURCE available to the completion files, we should replace a relative path to the absolute path before passing the path to `source` or `.`. To supply the absolute path, we add a new global variable `_comp__base_directory`, which contains the directory where `bash_completion` is located.
- Loading branch information