Commit e1a70c6
committed
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.1 parent 6f03827 commit e1a70c6
1 file changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3125 | 3125 | | |
3126 | 3126 | | |
3127 | 3127 | | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
3128 | 3140 | | |
3129 | 3141 | | |
3130 | 3142 | | |
| |||
3177 | 3189 | | |
3178 | 3190 | | |
3179 | 3191 | | |
3180 | | - | |
3181 | | - | |
3182 | | - | |
3183 | | - | |
3184 | | - | |
| 3192 | + | |
3185 | 3193 | | |
3186 | 3194 | | |
3187 | 3195 | | |
| |||
3323 | 3331 | | |
3324 | 3332 | | |
3325 | 3333 | | |
3326 | | - | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
| 3334 | + | |
| 3335 | + | |
3330 | 3336 | | |
3331 | | - | |
| 3337 | + | |
3332 | 3338 | | |
3333 | 3339 | | |
3334 | 3340 | | |
| |||
0 commit comments