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
+81-2
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,53 @@ And move it to ur path. Eg. `/usr/bin`, `/usr/local/bin`, etc. For windows, the
9
9
10
10
## Configurations
11
11
12
-
Complete Configurations Example:
12
+
General usage is:
13
+
14
+
```text
15
+
xuerun [tasks]... [options]...
16
+
```
17
+
18
+
TL;DR
19
+
20
+
```shell
21
+
$ xuerun # will execute 'all' task if exist
22
+
$ xuerun task-name-to-execute # will execute 'task-name-to-execute'
23
+
$ xuerun -t some-tasks-path # will look for task in 'some-tasks-path'
24
+
$ xuerun -n some-task # will print commands to run ( won't execute )
25
+
```
26
+
27
+
### Tasks Path ( `--tasks, -t` option )
28
+
29
+
Unless `--tasks ( -t )` is given, XueRun will look for `tasks.xuerun`. If `tasks.xuerun` exists, XueRun will use that.
30
+
31
+
```shell
32
+
$ xuerun someName # xuerun will look for someName in tasks.xuerun
33
+
$ xuerun -t example.xuerun someName # xuerun will look for someName in example.xuerun
34
+
```
35
+
36
+
### Task Name ( `[tasks]` )
37
+
38
+
Unless task names are given, XueRun will look for a task named `all`. If `all` task exists, XueRun will execute that.
39
+
40
+
```shell
41
+
$ xuerun task-name-to-execute
42
+
```
43
+
44
+
You can give multiple task name too.
45
+
46
+
```shell
47
+
$ xuerun taskOne taskTwo taskThree # these tasks will run in sequantial order.
48
+
```
49
+
50
+
### Recon ( `--recon, -n` option )
51
+
52
+
Use `--recon ( -n )` to emulate task execution ( but won't work in some edge cases ).
53
+
54
+
```shell
55
+
$ xuerun -n some-task # xuerun will print commands instead of executing
56
+
```
57
+
58
+
### Complete Configurations Example
13
59
14
60
```yaml
15
61
dependOnMeToo:
@@ -20,7 +66,7 @@ dependOnMeToo:
20
66
when: opt.release # if opt.release is true
21
67
- cmd: echo "Since passParentOptions is true in 'dependOnMe' task"
22
68
when: opt.release # if opt.release is true
23
-
passEnv: [ PATH ] # u need to pass env to use ur PATH.
69
+
passEnv: [ PATH ] # u need to pass env to use ur PATH. Pass true to pass all environment variables
24
70
dependOnMe:
25
71
description: some task
26
72
# cwd: / # try change cwd and see {{ Deno.cwd() }} output!
@@ -48,6 +94,38 @@ taskName:
48
94
49
95
I think this example show u a lot! Have Fun xuerunning!
50
96
97
+
## Some Notes
98
+
99
+
Here's some notes to be considered.
100
+
101
+
### Option passing
102
+
103
+
If u specified `passEnv` and `passCLI`, given env and CLI arguments will be passed to `opt` object and can be used with `{{}}`
104
+
105
+
106
+
107
+
### When Option ( WARNING )
108
+
109
+
This `taskName > command > subcommand > when` ( when ) expression is evaluated using `eval` function from javascript and can inject raw JS codes. So, use at ur own risk.
110
+
111
+
```yaml
112
+
- cmd: echo "Don't run me unless status is 'true'"
113
+
when: opt.status == 'true'
114
+
```
115
+
116
+
### JS Expression
117
+
118
+
You can use `{{ expression }}` in commands, options, etc. XueRun use `eta` to render those. string templates. Keep in mind, raw JS code can be injected too. So, use at ur own risk.
0 commit comments