File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -995,12 +995,14 @@ def symlink(
995995 directory_path = path / directory
996996 if not directory_path .exists ():
997997 return # No touching link, dest doc not built yet.
998- if link .exists () and readlink (link ) == directory :
999- return # Link is already pointing to right doc.
1000- if link .exists ():
1001- link .unlink ()
1002- link .symlink_to (directory )
1003- run (["chown" , "-h" , ":" + group , str (link )])
998+
999+ link_exists = link .exists ()
1000+ if not link_exists or readlink (link ) != directory :
1001+ # Link does not exist or points to the wrong target.
1002+ if link_exists :
1003+ link .unlink ()
1004+ link .symlink_to (directory )
1005+ run (["chown" , "-h" , f":{ group } " , str (link )])
10041006 if not skip_cache_invalidation :
10051007 surrogate_key = f"{ language .tag } /{ name } "
10061008 purge_surrogate_key (http , surrogate_key )
You can’t perform that action at this time.
0 commit comments