mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
fix: the configuration file path is not being detected when it is enclosed in quotes
This commit is contained in:
@@ -129,7 +129,7 @@ func BackupTask(db *dbConfig, config *BackupConfig) {
|
||||
}
|
||||
}
|
||||
func startMultiBackup(bkConfig *BackupConfig, configFile string) {
|
||||
utils.Info("Starting backup task...")
|
||||
utils.Info("Starting Multi backup task...")
|
||||
conf, err := readConf(configFile)
|
||||
if err != nil {
|
||||
utils.Fatal("Error reading config file: %s", err)
|
||||
|
||||
@@ -155,6 +155,8 @@ func readConf(configFile string) (*Config, error) {
|
||||
|
||||
// checkConfigFile checks config files and returns one config file
|
||||
func checkConfigFile(filePath string) (string, error) {
|
||||
// Remove the quotes
|
||||
filePath = strings.Trim(filePath, `"`)
|
||||
// Define possible config file names
|
||||
configFiles := []string{filepath.Join(workingDir, "config.yaml"), filepath.Join(workingDir, "config.yml"), filePath}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user