Skip to content

Commit 39b2a8a

Browse files
committed
add example, fix wrong validation
1 parent be7df10 commit 39b2a8a

File tree

3 files changed

+80
-3
lines changed

3 files changed

+80
-3
lines changed

README.md

+42-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,48 @@ Just a make-like task runner but with more power! It's written in CoffeeScript +
55
## Downloads
66

77
Go to Release page and download builds!
8-
And move it to your path. Eg. `/usr/bin`, `/usr/local/bin`, etc. For windows, the same :P.
8+
And move it to ur path. Eg. `/usr/bin`, `/usr/local/bin`, etc. For windows, the same :P.
9+
10+
## Configurations
11+
12+
Complete Configurations Example:
13+
14+
```yaml
15+
dependOnMeToo:
16+
description: another task
17+
# cwd: /some/path/too
18+
command:
19+
- cmd: echo "I can read {{ opt.release }} if 'dependOnMe' task call me"
20+
when: opt.release # if opt.release is true
21+
- cmd: echo "Since passParentOptions is true in 'dependOnMe' task"
22+
when: opt.release # if opt.release is true
23+
passEnv: [ PATH ] # u need to pass env to use ur PATH.
24+
dependOnMe:
25+
description: some task
26+
# cwd: / # try change cwd and see {{ Deno.cwd() }} output!
27+
shell: bash # default shell
28+
dependencies:
29+
- name: dependOnMeToo
30+
passParentOptions: true
31+
command:
32+
- cmd: echo "I can read {{ opt.FOO }}"
33+
shell: zsh # u can use another shell rather than default one
34+
- cmd: echo "Don't run me unless status is 'true'"
35+
when: opt.status == 'true'
36+
- echo "I'm a command too. In {{ Deno.cwd() }}" # deno expressions are supported
37+
taskName:
38+
description: a description
39+
dependencies:
40+
- name: dependOnMe
41+
options:
42+
FOO: bar
43+
status: "{{ opt.status == 1 }}"
44+
release: "{{ opt.release }}" # u can use --release CLI option if passCLI is true
45+
passCLI: true
46+
command: echo "this is main task"
47+
```
48+
49+
I think this example show u a lot! Have Fun xuerunning!
950
1051
## How to Build
1152

example.xuerun

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
dependOnMeToo:
2+
description: another task
3+
# cwd: /some/path/too
4+
command:
5+
- cmd: echo "I can read {{ opt.release }} if 'dependOnMe' task call me"
6+
when: opt.release # if opt.release is true
7+
- cmd: echo "Since passParentOptions is true in 'dependOnMe' task"
8+
when: opt.release # if opt.release is true
9+
passEnv: [ PATH ] # u need to pass env to use ur PATH.
10+
dependOnMe:
11+
description: some task
12+
# cwd: / # try change cwd and see {{ Deno.cwd() }} output!
13+
shell: bash # default shell
14+
dependencies:
15+
- name: dependOnMeToo
16+
passParentOptions: true
17+
command:
18+
- cmd: echo "I can read {{ opt.FOO }}"
19+
shell: zsh # u can use another shell rather than default one
20+
- cmd: echo "Don't run me unless status is 'true'"
21+
when: opt.status == 'true'
22+
- echo "I'm a command too. In {{ Deno.cwd() }}" # deno expressions are supported
23+
taskName:
24+
description: a description
25+
dependencies:
26+
- name: dependOnMe
27+
options:
28+
FOO: bar
29+
status: "{{ opt.status == 1 }}"
30+
release: "{{ opt.release }}" # u can use --release CLI option if passCLI is true
31+
passCLI: true
32+
command: echo "this is main task"

src/schema.coffee

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import { create, defaulted, optional, union, object, record,
22
array, string, number, boolean, validate } from "https://esm.sh/superstruct";
33

44
# use eval?
5-
XueRunUserCmd = union([string(), object({ shell: optional(string()), cmd: string(),
6-
'when': defaulted(union([string(), number(), boolean()]), () => 'true') })]);
5+
XueRunUserCmd = union([
6+
string(),
7+
object({
8+
shell: optional(string()),
9+
cmd: string(),
10+
'when': defaulted(optional(union([string(), number(), boolean()])), () => 'true') }) ]);
711

812
XueRunIngredient$option = union([string(), number(), boolean()])
913
export XueRunIngredient = object

0 commit comments

Comments
 (0)