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.activate()
var opts = {}
{{if .Prompt -}}
opts.withPrompt = {{.Prompt}}
opts.invisibles = {{.Invisibles}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{end -}}
{{if .Type -}}
opts.ofType = {{.Type}}
{{end -}}
@ -22,6 +22,12 @@ opts.defaultName = {{.Name}}
{{if .Location -}}
opts.defaultLocation = {{.Location}}
{{end -}}
{{if .Invisibles -}}
opts.invisibles = {{.Invisibles}}
{{end -}}
{{if .Multiple -}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{end -}}
var res = app[{{.Operation}}](opts)
if (Array.isArray(res)) {
res.join({{.Separator}})

View file

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