fixed stylesheet embedding

This commit is contained in:
Daniel Fichtinger 2024-11-28 18:44:47 -05:00
parent c65ebfc809
commit 065c344c03
5 changed files with 192 additions and 14 deletions

View file

@ -47,6 +47,7 @@ func FileExists(path string) bool {
return !os.IsNotExist(err)
}
// CreateParents creates the parent directories required for a given path
func CreateParents(path string) error {
dir := filepath.Dir(path)
// Check if the parent directory already exists
@ -59,3 +60,12 @@ func CreateParents(path string) error {
}
return nil
}
func StripTopDir(path string) string {
cleanedPath := filepath.Clean(path)
components := strings.Split(cleanedPath, string(filepath.Separator))
if len(components) <= 1 {
return path
}
return filepath.Join(components[1:]...)
}