fixed version blocking (#251)

This commit is contained in:
RoyUP9
2021-08-30 15:11:14 +03:00
committed by GitHub
parent 80237c8090
commit e25e7925b6
3 changed files with 14 additions and 6 deletions

View File

@@ -40,8 +40,7 @@ func InitConfig(cmd *cobra.Command) error {
configFilePathFlag := cmd.Flags().Lookup(ConfigFilePathCommandName)
configFilePath := configFilePathFlag.Value.String()
if err := mergeConfigFile(configFilePath); err != nil {
_, isPathError := err.(*os.PathError)
if configFilePathFlag.Changed || !isPathError {
if configFilePathFlag.Changed || !os.IsNotExist(err) {
return fmt.Errorf("invalid config, %w\n"+
"you can regenerate the file by removing it (%v) and using `mizu config -r`", err, configFilePath)
}