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:
parent
c727534d29
commit
46af6ed9ef
1 changed files with 1 additions and 4 deletions
|
|
@ -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 || '') => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue