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: README.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,8 +66,9 @@ A module looks something like this:
66
66
│ └── WreckerClass.sh
67
67
| └── ...
68
68
└── lib
69
-
└── wrecker_library_file.sh
70
-
└── ...
69
+
| └── wrecker_library_file.sh
70
+
| └── ...
71
+
└── test.sh
71
72
```
72
73
73
74
> Feel free to add any folders or files you want to this -- this is simply the base structure that Ash uses. You can't break anything by adding new folders or files. You'll see I've even done this myself in [ash-make](https://github.com/ash-shell/ash-make).
@@ -83,6 +84,7 @@ name: Wrecker
83
84
package: github.com/ash-shell/wrecker
84
85
default_alias: wrecker
85
86
callable_prefix: Wrecker
87
+
test_prefix: Wrecker
86
88
```
87
89
88
90
**`name`**: This is the human readable name of your module. This value is used by other modules who might want to output the name of the current module. This field is **required**.
@@ -93,6 +95,8 @@ callable_prefix: Wrecker
93
95
94
96
**`callable_prefix`**: This field specifies the function prefix that Ash looks for in the callable file when calling upon a module (more detail in [the section below](#callable-modules)). This field is only required for modules that provide a callable file.
95
97
98
+
**`test_prefix`**: This field specifies the function prefix that [Test](https://github.com/ash-shell/test) looks for in the `test.sh` file when running tests. This field is only required when you want to add tests to your module.
99
+
96
100
#### callable.sh
97
101
98
102
This file is only required if you want your library to be callable. The contents of this file are explained in [this section](#callable-modules).
@@ -119,6 +123,12 @@ You can nest folders inside of `lib` for structure, but you'll need to manage im
119
123
120
124
Files in the `lib` directory are auto loaded for you in the callable portions of your module, so you don't have to import your own module.
121
125
126
+
#### test.sh
127
+
128
+
This is the file in which you can write unit tests for your modules.
129
+
130
+
The README of [ash-shell/test](https://github.com/ash-shell/test) goes into full detail of how this all works.
131
+
122
132
## Callable Modules
123
133
124
134
You can build your module to be directly callable from the command line.
0 commit comments