wisski-cloud-distillery/internal/dis/component/control/static/custom/assets.go
2023-01-08 13:53:53 +01:00

22 lines
603 B
Go

package custom
import (
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
// CustomAssetsPath is the path custom assets are stored at
func (custom *Custom) CustomAssetsPath() string {
return filepath.Join(custom.Config.DeployRoot, "core", "assets")
}
func (custom *Custom) CustomAssetPath(name string) string {
return filepath.Join(custom.CustomAssetsPath(), name)
}
func (custom *Custom) BackupName() string { return "custom" }
func (custom *Custom) Backup(context component.StagingContext) error {
return context.CopyDirectory("", custom.CustomAssetsPath())
}