File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 14
14
desc : Force the type of input between YAML or JSON file
15
15
example : yaml
16
16
mandatory : false
17
+ - name : outFile
18
+ desc : Force binary output to be written into a file
19
+ example : my-bin.bin
20
+ mandatory : false
17
21
18
22
todo :
19
23
- Convert from Base64
30
34
- name : Convert from Base64
31
35
check :
32
36
in :
33
- file : isString.default(__)
34
- type : isString.oneOf(['yaml','json']).default('yaml')
35
- path : isString.default("@")
37
+ file : isString.default(__)
38
+ type : isString.oneOf(['yaml','json']).default('yaml')
39
+ path : isString.default("@")
40
+ outFile : isString.default(__)
36
41
exec : |
37
42
var data = ""
38
43
46
51
47
52
var _s = $$(data).get(args.path)
48
53
if (isString(_s)) {
49
- print(af.fromBytes2String(af.fromBase64(_s)))
54
+ if (isString(args.outFile)) {
55
+ var _b = af.fromBase64(_s)
56
+ var os = io.writeFileStream(args.outFile)
57
+ ioStreamWriteBytes(os, _b)
58
+ os.close()
59
+ } else
60
+ print(af.fromBytes2String(af.fromBase64(_s)))
50
61
} else {
51
62
printErr("No string detected on '" + args.path + "': " + af.toSLON(_s))
52
- }
63
+ }
You can’t perform that action at this time.
0 commit comments