Fix error WRT deleting file in default overlay

This commit is contained in:
Gregory Kurtzer
2021-10-23 19:38:34 -07:00
parent bbf6398fed
commit 852ad6fb38

View File

@@ -24,10 +24,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
fileName = args[2]
}
if overlayName == "default" {
return errors.New("refusing to delete the default overlay")
}
if overlayKind != "system" && overlayKind != "runtime" {
return errors.New("overlay kind must be of type 'system' or 'runtime'")
}
@@ -49,6 +45,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if fileName == "" {
if overlayName == "default" {
return errors.New("refusing to delete the default overlay")
}
if Force {
err := os.RemoveAll(overlayPath)
if err != nil {