mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
samples loading shortcuts:
- use main branch by default in github shortcut - add bubo shortcut
This commit is contained in:
parent
5807dbfdac
commit
2ef35a8583
@ -162,9 +162,17 @@ export const samples = async (sampleMap, baseUrl = sampleMap._base || '', option
|
|||||||
if (handler) {
|
if (handler) {
|
||||||
return handler(sampleMap);
|
return handler(sampleMap);
|
||||||
}
|
}
|
||||||
|
if (sampleMap.startsWith('bubo:')) {
|
||||||
|
const [_, repo] = sampleMap.split(':');
|
||||||
|
sampleMap = `github:Bubobubobubobubo/dough-${repo}`;
|
||||||
|
}
|
||||||
if (sampleMap.startsWith('github:')) {
|
if (sampleMap.startsWith('github:')) {
|
||||||
let [_, path] = sampleMap.split('github:');
|
let [_, path] = sampleMap.split('github:');
|
||||||
path = path.endsWith('/') ? path.slice(0, -1) : path;
|
path = path.endsWith('/') ? path.slice(0, -1) : path;
|
||||||
|
if (path.split('/').length === 2) {
|
||||||
|
// assume main as default branch if none set
|
||||||
|
path += '/main';
|
||||||
|
}
|
||||||
sampleMap = `https://raw.githubusercontent.com/${path}/strudel.json`;
|
sampleMap = `https://raw.githubusercontent.com/${path}/strudel.json`;
|
||||||
}
|
}
|
||||||
if (sampleMap.startsWith('shabda:')) {
|
if (sampleMap.startsWith('shabda:')) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user