Skip to content

Commit

Permalink
Add --force flag to systemd_firstboot plugin to overwrite existing files
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed Dec 5, 2023
1 parent 48147fa commit b0d5695
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/plugins/systemd_firstboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func SystemdFirstboot(l logger.Interface, s schema.Stage, fs vfs.FS, console Con
args = append(args, fmt.Sprintf("--%s=%s", strings.ToLower(k), v))
}

if err := console.RunTemplate(args, "systemd-firstboot %s"); err != nil {
if err := console.RunTemplate(args, "systemd-firstboot --force %s"); err != nil {
errs = multierror.Append(errs, err)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/systemd_firstboot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ var _ = Describe("SystemdFirstboot", func() {
Expect(err).ShouldNot(HaveOccurred())

Expect(consoletests.Commands).Should(ContainElements(
"systemd-firstboot --locale=en_US.UTF-8",
"systemd-firstboot --keymap=us",
"systemd-firstboot --force --locale=en_US.UTF-8",
"systemd-firstboot --force --keymap=us",
))
Expect(len(consoletests.Commands)).To(Equal(2))
})
Expand Down

0 comments on commit b0d5695

Please sign in to comment.