Skip to content

Commit

Permalink
also use recipe_path in _update_version_feedstock_dir_local
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Jan 8, 2025
1 parent 06b56b3 commit 85c4173
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions conda_forge_tick/update_recipe/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,22 +601,24 @@ def _update_version_feedstock_dir_local(
) -> (bool, set):
feedstock_path = Path(feedstock_dir)

recipe = feedstock_path / "recipe" / "meta.yaml"
if recipe.exists():
recipe_path = None
recipe_path_v0 = feedstock_path / "recipe" / "meta.yaml"
recipe_path_v1 = feedstock_path / "recipe" / "recipe.yaml"
if recipe_path_v0.exists():
recipe_path = recipe_path_v0
updated_meta_yaml, errors = update_version(
recipe.read_text(), version, hash_type=hash_type
)
elif recipe_path_v1.exists():
recipe_path = recipe_path_v1
updated_meta_yaml, errors = update_version_v1(
feedstock_dir, version, hash_type
)
else:
recipe = feedstock_path / "recipe" / "recipe.yaml"
if recipe.exists():
updated_meta_yaml, errors = update_version_v1(
feedstock_dir, version, hash_type
)
else:
return False, {"no recipe found"}
return False, {"no recipe found"}

if updated_meta_yaml is not None:
recipe.write_text(updated_meta_yaml)
recipe_path.write_text(updated_meta_yaml)

return updated_meta_yaml is not None, errors

Expand Down

0 comments on commit 85c4173

Please sign in to comment.