From d94dc42c0c0ab21c1153e44ee25a1562c1a38bfe Mon Sep 17 00:00:00 2001
From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr>
Date: Thu, 6 May 2021 11:47:50 +0200
Subject: [PATCH] Symlink banner instead of copy, in speciesDir

---
 gga_init.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gga_init.py b/gga_init.py
index bd1beb4..f9e01d6 100755
--- a/gga_init.py
+++ b/gga_init.py
@@ -62,11 +62,10 @@ class DeploySpeciesStack(speciesData.SpeciesData):
         # use the default banner instead
         if "banner_path" in self.config.keys():
             if not config["banner_path"] == "" and os.path.isfile(os.path.abspath(config["banner_path"])):
-                banner_dest_path = os.path.abspath("./banner.png")
-                logging.info("Custom banner path: %s" % self.config["banner_path"])
-                # if os.path.samefile(os.path.abspath(config["banner_path"]), banner_dest_path):
-                    # shutil.copy(os.path.abspath(self.config["banner_path"]), banner_dest_path)
-                shutil.copy(os.path.abspath(self.config["banner_path"]), banner_dest_path)
+                banner_dest_path = os.path.join(self.species_dir, os.path.abspath("banner.png"))
+                if not os.path.samefile(os.path.abspath(config["banner_path"]),banner_dest_path):
+                    os.symlink(os.path.abspath(self.config["banner_path"]), banner_dest_path)
+                    logging.info("Custom banner added: symlink from %s" % self.config["banner_path"])
             else:
                 logging.debug("Using default banner for Tripal pages")
                 self.config.pop("banner_path", None)
-- 
GitLab