Skip to content

Commit f84b936

Browse files
committed
Handle broken symlinks in devcontainer set up
1 parent ea8d769 commit f84b936

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/local/butler/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def install_dependencies(platform_name=None):
351351

352352
def remove_symlink(target):
353353
"""Removes a symlink."""
354-
if not os.path.exists(target):
354+
if not os.path.lexists(target):
355355
return
356356

357357
if os.path.isdir(target) and get_platform() == 'windows':
@@ -372,7 +372,8 @@ def symlink(src, target):
372372
else:
373373
os.symlink(src, target)
374374

375-
assert os.path.exists(target), f'Failed to create {target} symlink for {src}.'
375+
assert os.path.lexists(
376+
target), f'Failed to create {target} symlink for {src}.'
376377

377378
print(f'Created symlink: source: {src}, target {target}.')
378379

0 commit comments

Comments
 (0)