feat(aa): ensure the template does not append useless space.

This commit is contained in:
Alexandre Pujol 2023-09-29 20:17:38 +01:00
parent eb98d2b49f
commit cb441733c0
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC

View file

@ -35,10 +35,10 @@
{{- "profile" -}}
{{- with .Name -}}
{{ . }}{{ " " }}
{{ " " }}{{ . }}
{{- end -}}
{{- with .Attachments -}}
{{ join . }}{{ " " }}
{{ " " }}{{ join . }}
{{- end -}}
{{- with .Attributes -}}
{{ " xattrs=(" }}{{ join . }}{{ ")" }}
@ -77,18 +77,15 @@
{{- end -}}
{{- if eq $type "Network" -}}
{{- if eq .AccessType "deny" -}}
{{ "deny " }}
{{- end -}}
{{ "network" }}
{{- with .Domain -}}
{{ . }}{{ " " }}
{{ " " }}{{ . }}
{{- end -}}
{{- with .Type -}}
{{ . }}
{{ " " }}{{ . }}
{{- else -}}
{{- with .Protocol -}}
{{ . }}
{{ " " }}{{ . }}
{{- end -}}
{{- end -}}
{{- "," -}}
@ -97,13 +94,13 @@
{{- if eq $type "Mount" -}}
{{- "mount" -}}
{{- with .FsType -}}
{{ "fstype=" }}{{ . }}{{ " " }}
{{ " fstype=" }}{{ . }}
{{- end -}}
{{- with .Options -}}
{{ " options=(" }}{{ join . }}{{ ")" }}
{{- end -}}
{{- with .Source -}}
{{ . }}{{ " " }}
{{ " " }}{{ . }}
{{- end -}}
{{- with .MountPoint -}}
{{ " -> " }}{{ . }}
@ -114,13 +111,13 @@
{{- if eq $type "Umount" -}}
{{- "umount" -}}
{{- with .FsType -}}
{{ "fstype=" }}{{ . }}{{ " " }}
{{ " fstype=" }}{{ . }}
{{- end -}}
{{- with .Options -}}
{{ " options=(" }}{{ join . }}{{ ")" }}
{{- end -}}
{{- with .MountPoint -}}
{{ . }}
{{ " " }}{{ . }}
{{- end -}}
{{- "," -}}
{{- end -}}
@ -128,13 +125,13 @@
{{- if eq $type "Remount" -}}
{{- "remount" -}}
{{- with .FsType -}}
{{ "fstype=" }}{{ . }}{{ " " }}
{{ " fstype=" }}{{ . }}
{{- end -}}
{{- with .Options -}}
{{ " options=(" }}{{ join . }}{{ ")" }}
{{- end -}}
{{- with .Remount -}}
{{ . }}
{{ " " }}{{ . }}
{{- end -}}
{{- "," -}}
{{- end -}}
@ -145,10 +142,10 @@
{{ " (" }}{{ . }}{{ ")" }}
{{- end -}}
{{- with .Type -}}
{{ "type=" }}{{ . }}{{ " " }}
{{ " type=" }}{{ . }}
{{- end -}}
{{- with .Address -}}
{{ "addr=" }}{{ . }}{{ " " }}
{{ " addr=" }}{{ . }}
{{- end -}}
{{- if .Peer -}}
{{ " peer=(label=" }}{{ .Peer }}
@ -188,9 +185,16 @@
{{- if eq $type "Dbus" -}}
{{- "dbus" -}}
{{- if eq .Access "bind" -}}
bind bus={{ .Bus }} name={{ .Name }}
{{ " bind bus=" }}{{ .Bus }}{{ " name=" }}{{ .Name }}
{{- else -}}
{{ .Access }} bus={{ .Bus }} path={{ .Path }}{{ "\n" }}
{{ " " }}{{ .Access }}
{{- with .Bus -}}
{{ " bus=" }}{{ . }}
{{- end -}}
{{- with .Path -}}
{{ " path=" }}{{ . }}
{{- end -}}
{{ "\n" }}
{{- with .Interface -}}
{{ overindent "interface=" }}{{ . }}{{ "\n" }}
{{- end -}}