Linux install: remove broken symlinks when installing launchers, instead of erroring out

This commit is contained in:
Kovid Goyal 2010-01-11 10:33:58 -07:00
parent 94ce2cf8da
commit f77573d7f7

View File

@ -191,6 +191,8 @@ class Develop(Command):
if not os.path.exists(self.staging_bindir): if not os.path.exists(self.staging_bindir):
os.makedirs(self.staging_bindir) os.makedirs(self.staging_bindir)
self.info('Installing binary:', path) self.info('Installing binary:', path)
if os.path.lexists(path) and not os.path.exists(path):
os.remove(path)
open(path, 'wb').write(script) open(path, 'wb').write(script)
os.chmod(path, self.MODE) os.chmod(path, self.MODE)
self.manifest.append(path) self.manifest.append(path)