Check existence before remove symlink when deploying

This commit is contained in:
leafee98 2023-03-31 16:57:56 +08:00
parent 340c788c7f
commit 8a22d1fa93

View file

@ -118,6 +118,7 @@ class FileManager:
return False return False
self.logger.info("Recreating symlink point to {}".format(extract_dir)) self.logger.info("Recreating symlink point to {}".format(extract_dir))
if Path(self.symlink_path).exists():
os.remove(self.symlink_path) os.remove(self.symlink_path)
os.symlink(extract_dir, self.symlink_path) os.symlink(extract_dir, self.symlink_path)