File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,24 @@ $defs:
6767 source :
6868 type : string
6969 description : |
70- Location of the package (github user/repo, URL, or local path)
70+ Location of the package (github user/repo, URL, or local path)
71+ name :
72+ type : string
73+ description : Output filename (defaults to source repo name if not set)
74+ asset :
75+ description : Asset filter(s) passed to eget --asset (string or list)
76+ oneOf :
77+ - type : string
78+ - type : array
79+ items :
80+ type : string
81+ file :
82+ type : string
83+ description : Glob passed to eget --file to select files for extraction
84+ download_only :
85+ type : boolean
86+ description : Pass --download-only (no extraction)
87+ additionalProperties : false
7188
7289 uvDef :
7390 description : |
Original file line number Diff line number Diff line change 189189{{ end -}}
190190{{ if $eget }}
191191{{ range $name , $pkg := $eget -}}
192+ {{- $egetTo := " ~/.local/bin/" -}}
193+ {{- if hasKey $pkg " name" -}}{{- $egetTo = printf " ~/.local/bin/%s " $pkg .name -}}{{- end -}}
194+ {{- $egetCmd := printf " eget %s --to %s " ($pkg .source | quote) $egetTo -}}
195+ {{- if hasKey $pkg " asset" -}}
196+ {{- $assets := $pkg .asset -}}
197+ {{- if kindIs " string" $assets -}}{{- $assets = list $assets -}}{{- end -}}
198+ {{- range $a := $assets -}}
199+ {{- $egetCmd = printf " %s --asset %s " $egetCmd ($a | quote) -}}
200+ {{- end -}}
201+ {{- end -}}
202+ {{- if hasKey $pkg " file" -}}
203+ {{- $egetCmd = printf " %s --file %s " $egetCmd ($pkg .file | quote) -}}
204+ {{- end -}}
205+ {{- if and (hasKey $pkg " download_only" ) $pkg .download_only -}}
206+ {{- $egetCmd = printf " %s --download-only" $egetCmd -}}
207+ {{- end -}}
192208{{ if hasKey $checks $name -}}
193209dot::step::start " install {{ $name }} with eget"
194210if dot::has_command {{ (get $checks $name ).command | quote }}; then
195211 dot::step::skipped " already installed"
196212else
197- eget {{ $pkg .source | quote }} -t ~/ .local /bin/
213+ {{ $egetCmd }}
198214 dot::step::done
199215fi
200216{{ else -}}
201217dot::step::start " install {{ $name }} with eget"
202- eget {{ $pkg .source | quote }} -t ~/ .local /bin/
218+ {{ $egetCmd }}
203219dot::step::done
204220{{ end -}}
205221{{ end -}}
You can’t perform that action at this time.
0 commit comments