internal/component => internal/dis/component
This commit is contained in:
parent
9443217441
commit
b5b1ce2340
123 changed files with 76 additions and 76 deletions
41
internal/dis/component/exporter/extras_config.go
Normal file
41
internal/dis/component/exporter/extras_config.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package exporter
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
)
|
||||
|
||||
// Config implements backing up configuration
|
||||
type Config struct {
|
||||
component.Base
|
||||
}
|
||||
|
||||
func (*Config) BackupName() string {
|
||||
return "config"
|
||||
}
|
||||
|
||||
func (control *Config) Backup(context component.StagingContext) error {
|
||||
files := control.backupFiles()
|
||||
|
||||
return context.AddDirectory("", func() error {
|
||||
for _, src := range files {
|
||||
name := filepath.Base(src)
|
||||
if err := context.CopyFile(name, src); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// backupfiles lists the files to be backed up.
|
||||
func (control *Config) backupFiles() []string {
|
||||
return []string{
|
||||
control.Config.ConfigPath,
|
||||
control.Config.ExecutablePath(),
|
||||
control.Config.SelfOverridesFile,
|
||||
control.Config.SelfResolverBlockFile,
|
||||
control.Config.GlobalAuthorizedKeysFile,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue