Skip to content

Commit 1289909

Browse files
fix(cli): bundle resolver uses /HEAD/ instead of /main/ (JavaScriptSolidServer#487)
GitHub's raw URLs resolve /HEAD/ to the repo's default branch automatically. Works for both gh-pages-default repos (solid-apps convention) and main-default repos (everyone else's GitHub default). Better than picking one branch name. Smoke: `jss install --bundle starter` against solid-apps/bundles (default branch gh-pages) → 4/4 installed end-to-end.
1 parent 99d8bcb commit 1289909

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/cli/install.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function parseAppSpec(input) {
9191
* Resolve a `--bundle` source string to either a fully-qualified URL
9292
* or an absolute local-file path.
9393
*
94-
* --bundle media → github.com/solid-apps/bundles/main/media.jsonld
95-
* --bundle <org>/<repo> → github.com/<org>/<repo>/main/bundle.jsonld
94+
* --bundle media → github.com/solid-apps/bundles/HEAD/media.jsonld
95+
* --bundle <org>/<repo> → github.com/<org>/<repo>/HEAD/bundle.jsonld
9696
* --bundle https://... → as-is (must end in a JSON-LD doc)
9797
* --bundle ./path or /abs/path → absolute local-file path
9898
*
@@ -118,12 +118,12 @@ function resolveBundleSource(input) {
118118
if (cleaned.split('/').length !== 2) {
119119
return { error: 'expected <org>/<repo> shorthand for bundle source' };
120120
}
121-
return { url: `https://raw.githubusercontent.com/${cleaned}/main/bundle.jsonld` };
121+
return { url: `https://raw.githubusercontent.com/${cleaned}/HEAD/bundle.jsonld` };
122122
}
123123
if (!/^[a-z0-9][a-z0-9_.-]*$/i.test(input)) {
124124
return { error: `invalid bundle name "${input}"` };
125125
}
126-
return { url: `https://raw.githubusercontent.com/solid-apps/bundles/main/${input}.jsonld` };
126+
return { url: `https://raw.githubusercontent.com/solid-apps/bundles/HEAD/${input}.jsonld` };
127127
}
128128

129129
/**

0 commit comments

Comments
 (0)