quadlet: Embed the correct binary name in the generated comment

The binary name is not the same as in the old quadlet, and can anyway
differ in system and user runs, so use os.Args[0] to get the right name
in the comment.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
This commit is contained in:
Alexander Larsson
2022-10-20 10:04:23 +02:00
parent 2b0d9cd94b
commit af67f15bc7

View File

@ -134,7 +134,7 @@ func generateServiceFile(service *parser.UnitFile) error {
Debugf("writing '%s'", service.Path)
service.PrependComment("",
"Automatically generated by quadlet-generator",
fmt.Sprintf("Automatically generated by %s", os.Args[0]),
"")
f, err := os.Create(service.Path)