[ci skip] functionbuilder again
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2023-11-21 15:31:31 +11:00
parent cf43f67f68
commit 145af7dbdc
4 changed files with 15 additions and 12 deletions

View File

@@ -138,7 +138,7 @@ func init() {
"cmds": [ "cmds": [
{ {
"action": "foreach", "action": "foreach",
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .OutFilename }}'", "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .Body.OutFilename }}'",
"loop": ".Sheets", "loop": ".Sheets",
"print": true, "print": true,
"silent": false "silent": false
@@ -302,7 +302,7 @@ func init() {
"cmds": [ "cmds": [
{ {
"action": "foreach", "action": "foreach",
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .OutFilename }}'", "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .Body.OutFilename }}'",
"loop": ".Sheets", "loop": ".Sheets",
"print": true, "print": true,
"silent": false "silent": false

View File

@@ -185,7 +185,7 @@ func runCommand0(ctx context.Context,
params.DirektivDir, params.DirektivDir,
} }
cmd, err := templateString(`/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .OutFilename }}'`, ls) cmd, err := templateString(`/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .Body.OutFilename }}'`, ls)
if err != nil { if err != nil {
ir := make(map[string]interface{}) ir := make(map[string]interface{})
ir[successKey] = false ir[successKey] = false

View File

@@ -125,7 +125,8 @@ paths:
- action: foreach - action: foreach
loop: .Sheets loop: .Sheets
#exec: /bin/json2excel -inputJson {{- if eq (deref .Infile) "" }} "input.json" {{- else }} {{ .Infile }} {{- end }} -worksheetName "{{ .WorksheetName }}" -outputFilename '{{ .OutFilename }}' #exec: /bin/json2excel -inputJson {{- if eq (deref .Infile) "" }} "input.json" {{- else }} {{ .Infile }} {{- end }} -worksheetName "{{ .WorksheetName }}" -outputFilename '{{ .OutFilename }}'
exec: /bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .OutFilename }}' exec: /bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .Body.OutFilename }}'
#exec: ls -la /bin && echo "test" > {{ .Body.OutFilename }}
silent: false silent: false
print: true print: true
- action: exec - action: exec

View File

@@ -9,19 +9,21 @@ states:
action: action:
function: export-xlsx function: export-xlsx
input: input:
files:
- data: "jq(.input) \n"
name: input.json
out-filename: example.xlsx out-filename: example.xlsx
worksheet-name: TestSpreadsheet sheets:
- input-file:
- data: jq(.input)
name: input.json
name: TestSpreadsheet
transition: state1 transition: state1
- id: state1 - id: state1
type: action type: action
action: action:
function: export-xlsx function: export-xlsx
input: input:
files:
- data: "jq(.array | {input: . } | tostring ) \n"
name: input.json
out-filename: example.xlsx out-filename: example.xlsx
worksheet-name: TestSpreadsheet sheets:
- input-file:
- data: 'jq(.array | {input: . } | tostring ) '
name: input.json
name: TestSpreadsheet