Fix a bug introduced by #4e17cfbdd6

When there's no subpath for a Github path, the URL should end with a '/'. Otherwise when we concatenate values on from a sample map it doesn't separate the base URL from the filename.

Signed-off-by: milliganf <m.h.freeson@outlook.com>
This commit is contained in:
milliganf
2025-10-20 22:30:58 +02:00
parent c727534d29
commit 46af6ed9ef
+1 -4
View File
@@ -129,12 +129,9 @@ function githubPath(base, subpath = '') {
let repo = components.length >= 2 ? components[1] : 'samples';
let branch = components.length >= 3 ? components[2] : 'main';
let other = components.slice(3);
if (subpath) {
other.push(subpath);
}
other = other.join('/');
return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`;
return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}/${subpath}`;
}
export const processSampleMap = (sampleMap, fn, baseUrl = sampleMap._base || '') => {