From 509201c980fa8de0f5908f10f5bbb44ca0166cb8 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 21 Apr 2020 12:05:30 +0200
Subject: [PATCH] Handle ssh git origin urls for generating the build config

In case the repo isn't pulled through https.
---
 rollup.config.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/rollup.config.js b/rollup.config.js
index 3a33c6b..135c9e2 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -133,6 +133,11 @@ function getBuildInfo() {
     let commit = child_process.execSync('git rev-parse --short HEAD').toString().trim();
 
     let parsed = url.parse(remote);
+    // convert git urls
+    if (parsed.protocol === null) {
+        parsed = url.parse('git://' + remote.replace(":", "/"));
+        parsed.protocol = 'https:';
+    }
     let newPath = parsed.path.slice(0, parsed.path.lastIndexOf('.'));
     let newUrl = parsed.protocol + '//' + parsed.host + newPath + '/commit/' + commit;
 
-- 
GitLab