-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.jsx
69 lines (52 loc) · 1.2 KB
/
test.jsx
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
import { Batch, Run, invoke, Log, Prompt, mask } from "./dist/index.js";
import assert from "assert";
let version = "";
let type = "";
const Node = {
Version() {
return <Run
cmd="node"
args={["--version"]}
/>
}
};
const masked = mask `/p:Password=${"abcd123"}`;
await invoke(<Batch>
<Run
cmd="node"
args={["--version"]}
logData={false}
then={(x) => version = x.text.trim() }
/>
{
/** Execute Code in the curly braces, this will not be printed. */
version = version + "..."
}
<Log
text={version}
/>
{ /** Print following text directly on console... */
console.log("Executing Node")
}
<Run
cmd="node"
args="--version"
/>
<Node.Version/>
<Prompt
message="Type"
choices={[{
title: "One"
}, {
title:"Two"
}, {
title: "Three"
}]}
then={(v) => type = v}
/>
{ console.log(type)}
{ console.log(masked)}
{ console.log(masked.secret)}
{ assert.fail("Failed")}
{ console.log("Should not print")}
</Batch>)