Additional fixups, thanks @elguero!

This commit is contained in:
Gregory Kurtzer
2021-09-14 21:36:27 -07:00
parent 9581281cb4
commit c6f723d52f
2 changed files with 37 additions and 1 deletions

View File

@@ -44,6 +44,11 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
if util.IsFile(path.Join(overlaySource, dest)) {
wwlog.Printf(wwlog.ERROR, "A file with that name already exists in the %s overlay %s\n:", overlayKind, overlayName)
os.Exit(1)
}
err := util.CopyFile(source, path.Join(overlaySource, dest))
if err != nil {
return errors.Wrap(err, "could not copy file into overlay")