From 653ee48af07e8d833f4b724e47c4c8b6e279f736 Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Tue, 19 Apr 2022 12:07:47 +0200 Subject: [PATCH] getBuildInfo: also handle ssh remotes Convert them to the matching https equivalent. probably gitlab specific, but works for now.. --- rollup.utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rollup.utils.js b/rollup.utils.js index 4097769c..b99825ad 100644 --- a/rollup.utils.js +++ b/rollup.utils.js @@ -9,6 +9,10 @@ export function getBuildInfo(build) { let remote = child_process.execSync('git config --get remote.origin.url').toString().trim(); let commit = child_process.execSync('git rev-parse --short HEAD').toString().trim(); + if (remote.indexOf('git@') === 0) { + remote = remote.replace(':', '/').replace('git@', 'https://'); + } + let parsed = url.parse(remote); let newPath = parsed.path.slice(0, parsed.path.lastIndexOf('.')); let newUrl = parsed.protocol + '//' + parsed.host + newPath + '/commit/' + commit; -- GitLab