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
Failed to generate hash of commit

View file

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