1
0
Fork 0

[GITEA] add GetFile to config provider

(cherry picked from commit 88d1b53eea)
(cherry picked from commit f63f71afad)
This commit is contained in:
Earl Warren 2023-08-11 11:06:31 +02:00
parent f10faffb4f
commit 1f774145fc
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -53,6 +53,7 @@ type ConfigProvider interface {
Save() error
SaveTo(filename string) error
GetFile() string
DisableSaving()
PrepareSaving() (ConfigProvider, error)
IsLoadedFromEmpty() bool
@ -251,6 +252,10 @@ func (p *iniConfigProvider) GetSection(name string) (ConfigSection, error) {
var errDisableSaving = errors.New("this config can't be saved, developers should prepare a new config to save")
func (p *iniConfigProvider) GetFile() string {
return p.file
}
// Save saves the content into file
func (p *iniConfigProvider) Save() error {
if p.disableSaving {