You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,17 +27,19 @@ This order is subject to change.
27
27
28
28
For `aliases`, `plugins` and `completions`, the following rules are applied that influence the load order:
29
29
30
-
*Each type has its own `enabled` directory, into which the enabled components are linked into. Enabled plugins are symlinked from `$BASH_IT/plugins/available` to `$BASH_IT/plugins/enabled` for example.
31
-
* Within each of the `enabled` directories, the files are loaded in alphabetical order.
30
+
*There is a global `enabled` directory, which the enabled components are linked into. Enabled plugins are symlinked from `$BASH_IT/plugins/available` to `$BASH_IT/enabled` for example. All component types are linked into the same common `$BASH_IT/enabled` directory.
31
+
* Within the common `enabled` directories, the files are loaded in alphabetical order, which is based on the item's load priority (see next item).
32
32
* When enabling a component, a _load priority_ is assigned to the file. The following default priorities are used:
33
33
* Aliases: 150
34
34
* Plugins: 250
35
35
* Completions: 350
36
-
* When symlinking a component into an`enabled` directory, the load priority is used as a prefix for the linked name, separated with three dashes from the name of the component. The `node.plugin.bash` would be symlinked to `250---node.plugin.bash` for example.
36
+
* When symlinking a component into the`enabled` directory, the load priority is used as a prefix for the linked name, separated with three dashes from the name of the component. The `node.plugin.bash` would be symlinked to `250---node.plugin.bash` for example.
37
37
* Each file can override the default load priority by specifying a new value. To do this, the file needs to include a comment in the following form. This example would cause the `node.plugin.bash` (if included in that file) to be linked to `225---node.plugin.bash`:
38
38
39
39
```bash
40
40
# BASH_IT_LOAD_PRIORITY: 225
41
41
```
42
42
43
+
Having the order based on a numeric priority in a common directory allows for more flexibility. While in general, aliases are loaded first (since their default priority is 150), it's possible to load some aliases after the plugins, or some plugins after completions by setting the items' load priority. This is more flexible than a fixed type-based order or a strict alphabetical order based on name.
44
+
43
45
These items are subject to change. When making changes to the internal functionality, this page needs to be updated as well.
## Testing with [Bats](https://github.com/sstephenson/bats#installing-bats-from-source)
2
+
3
+
To execute the unit tests, please run the `run` script:
4
+
5
+
```bash
6
+
# If you are in the `test` directory:
7
+
./run
8
+
9
+
# If you are in the root `.bash_it` directory:
10
+
test/run
2
11
```
3
-
bats test/{lib,plugins}
4
-
```
12
+
13
+
The `run` script will automatically install [Bats](https://github.com/sstephenson/bats#installing-bats-from-source) if it is not already present, and will then run all tests found under the `test` directory, including subdirectories.
0 commit comments