Create named subdirectories for new repositories
This commit is contained in:
@@ -226,6 +226,11 @@ func (s *Service) TestRepository(ctx context.Context, repoID string, initialize
|
||||
}
|
||||
defer s.mounts.Cleanup(context.Background(), mounted)
|
||||
if initialize {
|
||||
if mounted.Repository.Type != model.RepositorySFTP {
|
||||
if err := os.MkdirAll(mounted.Repository.Location, 0750); err != nil {
|
||||
return fmt.Errorf("repository: create destination directory: %w", err)
|
||||
}
|
||||
}
|
||||
return s.restic.Init(ctx, mounted.Repository)
|
||||
}
|
||||
_, err = s.restic.Snapshots(ctx, mounted.Repository)
|
||||
|
||||
Reference in New Issue
Block a user