-
Notifications
You must be signed in to change notification settings - Fork 121
/
condition.toml
executable file
·80 lines (65 loc) · 1.87 KB
/
condition.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[env]
TRUE_ENV = "true"
FALSE_ENV = "false"
[tasks.test-condition]
condition = { platforms = ["windows", "linux"], channels = ["beta", "nightly"] }
script = '''
echo "condition was met"
'''
[tasks.test-rust-version-condition]
condition = { rust_version = { min = "1.20.0", max = "1.30.0" } }
script = '''
echo "rust version condition was met"
'''
[tasks.test1]
command = "echo"
args = ["running test1"]
[tasks.test2]
command = "echo"
args = ["running test2"]
[tasks.test3]
command = "echo"
args = ["running test3"]
[tasks.test-default]
command = "echo"
args = ["running test-default"]
[tasks.test-routing]
run_task = [
{ name = "test1", condition = { platforms = ["windows", "linux"], channels = ["beta", "stable"] } },
{ name = "test2", condition = { platforms = ["mac"], rust_version = { min = "1.20.0", max = "1.30.0" } } },
{ name = "test3", condition_script = ["somecommand"] },
{ name = "test-default" },
]
[tasks.test-true-condition]
condition = { env_true = ["TRUE_ENV"] }
script = '''
echo "condition was met"
'''
[tasks.test-false-condition]
condition = { env_false = ["FALSE_ENV"] }
script = '''
echo "condition was met"
'''
[tasks.test-file-exists-condition]
condition = { files_exist = ["${CARGO_MAKE_WORKING_DIRECTORY}/Cargo.toml"] }
script = '''
echo "condition was met"
'''
[tasks.test-file-not-exists-condition]
condition = { files_not_exist = ["${CARGO_MAKE_WORKING_DIRECTORY}/Cargo.toml2"] }
script = '''
echo "condition was met"
'''
[tasks.test-condition-script]
condition_script = ["exit 1"]
command = "echo"
args = ["condition was met"]
[tasks.test-condition-with-message]
condition = { platforms = ["windows"], fail_message = "Condition Failed." }
command = "echo"
args = ["condition was met"]
[tasks.test-condition-script-with-message]
condition = { fail_message = "Condition Script Failed." }
condition_script = ["exit 1"]
command = "echo"
args = ["condition was met"]