From 1f8d23f1b5c15d99c174d655a54d98deefc34cc0 Mon Sep 17 00:00:00 2001
From: Ned Coltman <edward.coltman@iws.uni-stuttgart.de>
Date: Wed, 11 Jan 2023 16:42:36 +0100
Subject: [PATCH] [bin][installscript][writer] remove ".git" with endswith
 check rather than rstrip

---
 bin/util/installscript_writer.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/util/installscript_writer.py b/bin/util/installscript_writer.py
index 056176126e..09381d0341 100644
--- a/bin/util/installscript_writer.py
+++ b/bin/util/installscript_writer.py
@@ -208,7 +208,9 @@ class InstallScriptWriterPython(InstallScriptWriterInterface):
 
 
             def installModule(subFolder, url, branch, revision):
-                targetFolder = url.rstrip(".git").split("/")[-1]
+                targetFolder = url.split("/")[-1]
+                if targetFolder.endswith(".git"):
+                    targetFolder = targetFolder[:-4]
                 if not os.path.exists(targetFolder):
                     runFromSubFolder(['git', 'clone', url, targetFolder], '.')
                     runFromSubFolder(['git', 'checkout', branch], subFolder)
-- 
GitLab