Remove partials directory

This commit is contained in:
rafaelDev0ps 2024-11-13 21:48:40 -03:00
parent 54f2e769f3
commit ce1ccfda4c

View file

@ -485,19 +485,13 @@ func HasModuleFile(path string) bool {
return !os.IsNotExist(err) return !os.IsNotExist(err)
} }
func CheckProjectDirectories(path string) error { func CheckPagesDirectory(path string) error {
pagesPath := filepath.Join(path, "pages") pagesPath := filepath.Join(path, "pages")
_, err := os.Stat(pagesPath) _, err := os.Stat(pagesPath)
if err != nil { if err != nil {
return fmt.Errorf("The directory pages does not exist.") return fmt.Errorf("The directory pages does not exist.")
} }
partialsPath := filepath.Join(path, "partials")
_, err = os.Stat(partialsPath)
if err != nil {
return fmt.Errorf("The directory partials does not exist.")
}
return nil return nil
} }
@ -510,7 +504,7 @@ func GetModuleName() string {
return "" return ""
} }
checkDir := CheckProjectDirectories(wd) checkDir := CheckPagesDirectory(wd)
if checkDir != nil { if checkDir != nil {
fmt.Fprintf(os.Stderr, checkDir.Error()) fmt.Fprintf(os.Stderr, checkDir.Error())
return "" return ""