[client]: Add config flag to service to override default profile path (#4276)

[client]: Add config flag to service to override default profile path (#4276)
This commit is contained in:
hakansa
2025-08-05 12:33:43 +03:00
committed by GitHub
parent 348d981b2c
commit 9ccc13e6ea
10 changed files with 36 additions and 14 deletions
+2 -2
View File
@@ -558,7 +558,7 @@ func (g *BundleGenerator) addNetworkMap() error {
}
func (g *BundleGenerator) addStateFile() error {
sm := profilemanager.ServiceManager{}
sm := profilemanager.NewServiceManager("")
path := sm.GetStatePath()
if path == "" {
return nil
@@ -597,7 +597,7 @@ func (g *BundleGenerator) addStateFile() error {
}
func (g *BundleGenerator) addCorruptedStateFiles() error {
sm := profilemanager.ServiceManager{}
sm := profilemanager.NewServiceManager("")
pattern := sm.GetStatePath()
if pattern == "" {
return nil
+1 -1
View File
@@ -238,7 +238,7 @@ func NewEngine(
connSemaphore: semaphoregroup.NewSemaphoreGroup(connInitLimit),
}
sm := profilemanager.ServiceManager{}
sm := profilemanager.NewServiceManager("")
path := sm.GetStatePath()
if runtime.GOOS == "ios" {
+9 -1
View File
@@ -75,7 +75,15 @@ func (a *ActiveProfileState) FilePath() (string, error) {
return filepath.Join(configDir, a.Name+".json"), nil
}
type ServiceManager struct{}
type ServiceManager struct {
}
func NewServiceManager(defaultConfigPath string) *ServiceManager {
if defaultConfigPath != "" {
DefaultConfigPath = defaultConfigPath
}
return &ServiceManager{}
}
func (s *ServiceManager) CopyDefaultProfileIfNotExists() (bool, error) {