GetConfigFiles to get the list of config files
(cfgFile *[]string, cfgFileList string)
| 206 | |
| 207 | // GetConfigFiles to get the list of config files |
| 208 | func GetConfigFiles(cfgFile *[]string, cfgFileList string) error { |
| 209 | if len(cfgFileList) != 0 { |
| 210 | configfilelist, err := NewJTIMONConfigFilelist(cfgFileList) |
| 211 | if err != nil { |
| 212 | return fmt.Errorf("%v: [%v]", err, cfgFileList) |
| 213 | } |
| 214 | n := len(configfilelist.Filenames) |
| 215 | if n == 0 { |
| 216 | return fmt.Errorf("%s doesn't have any files", cfgFileList) |
| 217 | } |
| 218 | *cfgFile = configfilelist.Filenames |
| 219 | } else { |
| 220 | n := len(*cfgFile) |
| 221 | if n == 0 { |
| 222 | return fmt.Errorf("can not run without any config file") |
| 223 | } |
| 224 | } |
| 225 | return nil |
| 226 | } |
| 227 | |
| 228 | // DecodePassword will decode the password if decoder util is present in the config |
| 229 | func DecodePassword(jctx *JCtx, config Config) (string, error) { |