File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -995,12 +995,14 @@ def symlink(
995
995
directory_path = path / directory
996
996
if not directory_path .exists ():
997
997
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 )])
1004
1006
if not skip_cache_invalidation :
1005
1007
surrogate_key = f"{ language .tag } /{ name } "
1006
1008
purge_surrogate_key (http , surrogate_key )
You can’t perform that action at this time.
0 commit comments