From 46af6ed9ef9f91b19ec39005951730d04f2ec40e Mon Sep 17 00:00:00 2001 From: milliganf Date: Mon, 20 Oct 2025 22:30:58 +0200 Subject: [PATCH] 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 --- packages/superdough/sampler.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/superdough/sampler.mjs b/packages/superdough/sampler.mjs index 3232fa476..14e6d3fa3 100644 --- a/packages/superdough/sampler.mjs +++ b/packages/superdough/sampler.mjs @@ -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 || '') => {