Skip to content

Commit

Permalink
refactor: optimize config file deprecation check (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdre authored Sep 14, 2024
1 parent 41ac508 commit 0b14b44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/config/deploy_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ func GetDeployConfig(repoDir, name string) (*DeployConfig, error) {
}

// Check if the config file name is deprecated
if configFile == DeprecatedDeploymentConfigFileNames[0] || configFile == DeprecatedDeploymentConfigFileNames[1] {
return config, fmt.Errorf("%w: %s", ErrDeprecatedConfig, configFile)
for _, deprecatedConfigFile := range DeprecatedDeploymentConfigFileNames {
if configFile == deprecatedConfigFile {
return config, fmt.Errorf("%w: %s", ErrDeprecatedConfig, configFile)
}
}

return config, nil
Expand Down

0 comments on commit 0b14b44

Please sign in to comment.