From 04bf5f120aec35fd55fc5e9d03765fad0d508125 Mon Sep 17 00:00:00 2001 From: Daniel Gerber <394442-gerbsen@users.noreply.gitlab.com> Date: Fri, 17 Jul 2026 16:23:20 +0200 Subject: [PATCH] Support full clone URLs in getDocs (e.g. GitLab repos) getDocs.js hardcoded the GitHub host and prepended it to every `repo` entry in docs.package.json, so only GitHub repos could be imported. Resolve each entry to a clone URL instead: a full URL (https:// or git@) is used as-is, while a bare "owner/name" still falls back to the GitHub prefix for backwards compatibility. This unblocks adding application examples that live on GitLab. Co-Authored-By: Claude Opus 4.8 Signed-off-by: Daniel Gerber <394442-gerbsen@users.noreply.gitlab.com> --- getDocs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/getDocs.js b/getDocs.js index 92e15fae21..ad05384e50 100755 --- a/getDocs.js +++ b/getDocs.js @@ -10,12 +10,18 @@ const reposJson = fs const repos = JSON.parse(reposJson) const ghUrl = 'https://github.com/' +// Resolve a repo entry to a clone URL. +// A full URL (e.g. a GitHub or GitLab repo) is used as-is; a bare +// "owner/name" is treated as a GitHub shorthand for backwards compatibility. +const cloneUrl = (repo) => + /^(https?:\/\/|git@)/.test(repo) ? repo : ghUrl + repo + // Clone each repository, remove git folders and README files, and copy the docs to the target directory repos.forEach((repo) => { const repoDir = `repo_to_be_edited/${repo.label}` // Clone the repository - const cloneCommand = `git clone ${ghUrl + repo.repo} ${repoDir}` + const cloneCommand = `git clone ${cloneUrl(repo.repo)} ${repoDir}` execSync(cloneCommand) // Remove git folders