Fix sampler.mjs githubPath
PR https://codeberg.org/uzu/strudel/pulls/1679 introduced a subtle bug when both other and subpath are empty. The url should not end with '//'
This commit is contained in:
parent
ac37b6a029
commit
f0bd5bffaa
1 changed files with 2 additions and 1 deletions
|
|
@ -129,9 +129,10 @@ function githubPath(base, subpath = '') {
|
||||||
let repo = components.length >= 2 ? components[1] : 'samples';
|
let repo = components.length >= 2 ? components[1] : 'samples';
|
||||||
let branch = components.length >= 3 ? components[2] : 'main';
|
let branch = components.length >= 3 ? components[2] : 'main';
|
||||||
let other = components.slice(3);
|
let other = components.slice(3);
|
||||||
|
other.push(subpath ? subpath : '')
|
||||||
other = other.join('/');
|
other = other.join('/');
|
||||||
|
|
||||||
return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}/${subpath}`;
|
return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const processSampleMap = (sampleMap, fn, baseUrl = sampleMap._base || '') => {
|
export const processSampleMap = (sampleMap, fn, baseUrl = sampleMap._base || '') => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue