This commit is contained in:
Nuno Cruces 2020-01-15 01:04:06 +00:00
parent b3bca1feaa
commit b3dbb1a78a
2 changed files with 17 additions and 5 deletions

View file

@ -10,9 +10,9 @@ var scripts = template.Must(template.New("").Parse(`
app.includeStandardAdditions = true app.includeStandardAdditions = true
app.activate() app.activate()
var opts = {} var opts = {}
{{if .Prompt -}}
opts.withPrompt = {{.Prompt}} opts.withPrompt = {{.Prompt}}
opts.invisibles = {{.Invisibles}} {{end -}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{if .Type -}} {{if .Type -}}
opts.ofType = {{.Type}} opts.ofType = {{.Type}}
{{end -}} {{end -}}
@ -22,6 +22,12 @@ opts.defaultName = {{.Name}}
{{if .Location -}} {{if .Location -}}
opts.defaultLocation = {{.Location}} opts.defaultLocation = {{.Location}}
{{end -}} {{end -}}
{{if .Invisibles -}}
opts.invisibles = {{.Invisibles}}
{{end -}}
{{if .Multiple -}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{end -}}
var res = app[{{.Operation}}](opts) var res = app[{{.Operation}}](opts)
if (Array.isArray(res)) { if (Array.isArray(res)) {
res.join({{.Separator}}) res.join({{.Separator}})

View file

@ -3,10 +3,10 @@ app.includeStandardAdditions = true
app.activate() app.activate()
var opts = {} var opts = {}
opts.withPrompt = {{.Prompt}}
opts.invisibles = {{.Invisibles}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{if .Prompt -}}
opts.withPrompt = {{.Prompt}}
{{end -}}
{{if .Type -}} {{if .Type -}}
opts.ofType = {{.Type}} opts.ofType = {{.Type}}
{{end -}} {{end -}}
@ -16,6 +16,12 @@ opts.multipleSelectionsAllowed = {{.Multiple}}
{{if .Location -}} {{if .Location -}}
opts.defaultLocation = {{.Location}} opts.defaultLocation = {{.Location}}
{{end -}} {{end -}}
{{if .Invisibles -}}
opts.invisibles = {{.Invisibles}}
{{end -}}
{{if .Multiple -}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{end -}}
var res = app[{{.Operation}}](opts) var res = app[{{.Operation}}](opts)
if (Array.isArray(res)) { if (Array.isArray(res)) {