@@ -49,7 +49,6 @@ var ConfigStoreData []ConfigStore
49
49
var config * Config
50
50
51
51
func LoadConfig () (* Config , error ) {
52
- log .Printf ("Loading config file" )
53
52
if config != nil {
54
53
return config , nil
55
54
}
@@ -65,24 +64,20 @@ func LoadConfig() (*Config, error) {
65
64
viper .AddConfigPath (UserConfigDir )
66
65
67
66
exe , exeerr := os .Executable ()
68
- log .Printf ("Executable: %s" , exe )
69
67
var exeDir string
70
68
if exeerr != nil {
71
69
log .Printf ("Error getting executable: %v" , exeerr )
72
70
return nil , fmt .Errorf ("error getting executable: %w" , exeerr )
73
71
}
74
72
if filepath .Ext (exe ) == ".lnk" {
75
- log .Printf ("Shortcut detected: %s" , exe )
76
73
exePath , _ , direrr := shortcut .Read (exe )
77
74
if direrr != nil {
78
75
log .Printf ("Error reading shortcut: %v" , direrr )
79
76
return nil , fmt .Errorf ("error reading shortcut: %w" , direrr )
80
77
}
81
78
if exePath != "" {
82
- log .Printf ("Shortcut path: %s" , exePath )
83
79
exeDir = filepath .Dir (exePath )
84
80
} else {
85
- log .Printf ("Shortcut path is empty: %s" , exePath )
86
81
exeDir = ""
87
82
}
88
83
} else {
@@ -97,18 +92,13 @@ func LoadConfig() (*Config, error) {
97
92
98
93
// Log the configuration files found
99
94
for _ , path := range configPaths {
100
- log .Printf ("Checking config directory: %s" , path )
101
95
if path == "." {
102
- log .Println ("Getting current working directory" )
103
96
path , _ = os .Getwd ()
104
97
}
105
98
configFile := filepath .Join (path , "config.yaml" )
106
- log .Printf ("Checking config file: %s" , configFile )
107
99
if _ , err := os .Stat (configFile ); err == nil {
108
- log .Printf ("Config file exists: %s" , configFile )
109
100
ConfigStoreData = append (ConfigStoreData , ConfigStore {Path : path , Exists : true })
110
101
} else {
111
- log .Printf ("Config file doesn't exist: %s" , configFile )
112
102
ConfigStoreData = append (ConfigStoreData , ConfigStore {Path : path , Exists : false })
113
103
}
114
104
}
@@ -129,7 +119,6 @@ func LoadConfig() (*Config, error) {
129
119
log .Printf ("Unable to decode into struct: %v" , err )
130
120
return nil , fmt .Errorf ("unable to decode into struct: %w" , err )
131
121
}
132
- log .Printf ("Config file loaded: %+v" , config )
133
122
return config , nil
134
123
}
135
124
0 commit comments