Skip to content

Commit

Permalink
Improve symlink recreation logic (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Feb 25, 2022
1 parent 7314459 commit 7391b66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansible_compat/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def _install_galaxy_role(
target = pathlib.Path(project_dir).absolute()
exists = link_path.exists() or link_path.is_symlink()
if not exists or os.readlink(link_path) != str(target):
if exists:
if link_path.exists():
link_path.unlink()
link_path.symlink_to(str(target), target_is_directory=True)
_logger.info(
Expand Down

0 comments on commit 7391b66

Please sign in to comment.