Browse Source

[core] Check for file named hue.pth.lnk before creating it

Makes installation more resilient
Abraham Elmahrek 12 năm trước cách đây
mục cha
commit
0ee74d6
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      tools/app_reg/pth.py

+ 3 - 0
tools/app_reg/pth.py

@@ -140,6 +140,9 @@ class PthFile(object):
       LOG.info('=== Removed symbolic link at %s' % (self._symlink_path))
 
     if not os.path.islink(self._symlink_path):
+      if os.path.exists(self._symlink_path):
+        raise RuntimeError("Path %s already exists and is not a symbolic link." % self._symlink_path)
+
       LOG.info('=== Creating symbolic link at %s to %s' % (self._symlink_path, rel_symlink_path))
       os.symlink(rel_symlink_path, self._symlink_path)
       LOG.info('=== Created symbolic link at %s to %s' % (self._symlink_path, rel_symlink_path))