Skip to content

Commit b37da4e

Browse files
committed
Updated documentation for global directory
1 parent be9b0e7 commit b37da4e

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

DEVELOPMENT.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ This order is subject to change.
2727

2828
For `aliases`, `plugins` and `completions`, the following rules are applied that influence the load order:
2929

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).
3232
* When enabling a component, a _load priority_ is assigned to the file. The following default priorities are used:
3333
* Aliases: 150
3434
* Plugins: 250
3535
* 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.
3737
* 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`:
3838

3939
```bash
4040
# BASH_IT_LOAD_PRIORITY: 225
4141
```
4242

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+
4345
These items are subject to change. When making changes to the internal functionality, this page needs to be updated as well.

test/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
## 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
211
```
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

Comments
 (0)