Skip to content

Commit a9de557

Browse files
author
Florian Heinze
committed
TASK: updated README
1 parent 5062788 commit a9de557

2 files changed

Lines changed: 23 additions & 15 deletions

File tree

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Sandstorm Dev Script Runner
22

3+
Use a shell script to document recurring development tasks and run them from anywhere inside your projects
4+
folder structure using `dev some-task` while still being able to run them without this helper calling the
5+
script directly `./dev.sh some-task`.
6+
7+
## Features
8+
9+
* run your development tasks from within a nested folder structure
10+
* easy initialization of your project
11+
* autocompletion
12+
* documentation of your tasks will be used to provide help
13+
314
## Motivation
415

516
In all of our projects we have recurring tasks that require us running multiple commands, e.g. to
@@ -31,8 +42,8 @@ This is how we ended up with the following API to run your tasks.
3142
`./dev.sh sometask` or `dev sometask`
3243

3344
Some functionality will only be provided by the helper, e.g. running an init.
34-
As we do not want to confuse this additional functionality with running a task, we use UPPERCASE
35-
arguments prefixed with `DSR` for utils only provided by the `dev` command.
45+
As we do not want to confuse this additional functionality with running a task,
46+
we use UPPERCASE arguments prefixed with `DSR` for utils only provided by the `dev` command.
3647

3748
Example: `dev DSR_INIT` to create the files needed in your project.
3849

@@ -58,15 +69,18 @@ function sometask() {
5869
```
5970
**Tasks starting with `_` are expected to be private and will be ignored**
6071

61-
**You should not use UPPERCASE tasks in your `dev.sh`**
72+
**You should not use UPPERCASE tasks in your `dev.sh`** as they might be used to provide
73+
utilities. e.g. `dev DSR_INIT` to init your folder with all the files needed by the
74+
Dev Script Runner
6275

6376
### Passing arguments
6477

65-
You can run a task providing additional arguments that will be passed to your dev.sh
78+
You can run a task providing additional arguments that will be passed to your `dev.sh`
6679
transparently.
6780

6881
The only exception are the `-h` and `--help` flags that are handled by the DevScriptRunner.
69-
You should not use them in your `dev.sh` script.
82+
If you implement them in your `dev.sh` script they will only work if you call your script
83+
directly. `./dev.sh --help` will run your own implementation.
7084

7185
```bash
7286
dev sometask arg1 arg2 agr3
@@ -91,22 +105,16 @@ function sometask() {
91105
# Short description in first line
92106
#
93107
# Some more comments giving a detailed description about your task.
94-
# Your description can span multiple lines. There MUST not be any
95-
# empty lines for the comments to be associated with your task.
108+
# Your description can span multiple lines. There MUST NOT be any empty lines
109+
# between the comment block and your task.
96110
function sometask() {
97111
echo "TODO: implement"
98112
}
99113
```
100114

101-
This currently is WIP and will be improved in the future ;)
102-
103115
## Usage
104116

105117
run `dev` for more information.
106118

107119
## TODOs
108-
109-
* more testing
110-
* dev script parsing
111-
* e2e tests actually testing the CLI
112-
* more features for documenting tasks -> e.g. support usage, examples, params, ...
120+
* more features for documenting tasks -> e.g. support usage, examples, flags, params, ...

dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function setup() {
5454
# running tests
5555
function run-test() {
5656
pushd utils
57-
go test
57+
go test "$@"
5858
popd
5959
_log_success "All Tests finished successfully ;)"
6060
}

0 commit comments

Comments
 (0)