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
516In 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
3344Some 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
3748Example: ` 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 `
6679transparently.
6780
6881The 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
7286dev 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.
96110function sometask() {
97111 echo " TODO: implement"
98112}
99113```
100114
101- This currently is WIP and will be improved in the future ;)
102-
103115## Usage
104116
105117run ` 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, ...
0 commit comments