Skip to content

Commit

Permalink
move calculating valid version for cf build to right place
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson committed Mar 17, 2023
1 parent 2942bd9 commit 37e325f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ $(document).ready(function () {
const noneStable = version.includes('-');
if (CLOUDFLARE_PAGES) {
return `https://github.com/video-dev/hls.js/tree/${encodeURIComponent(
CLOUDFLARE_PAGES.branch.replace(/[^a-zA-Z-]/g, '-')
CLOUDFLARE_PAGES.branch
)}`;
} else if (noneStable) {
return `https://www.npmjs.com/package/hls.js/v/${encodeURIComponent(
Expand Down
5 changes: 4 additions & 1 deletion scripts/get-package-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ try {
intermediateVersion = intermediateVersion.substring(1);

const suffix = process.env.CF_PAGES
? `pr.${process.env.CF_PAGES_BRANCH}.${getCommitHash().slice(0, 8)}`
? `pr.${process.env.CF_PAGES_BRANCH.replace(
/[^a-zA-Z-]/g,
'-'
)}.${getCommitHash().slice(0, 8)}`
: `0.canary.${getCommitNum()}`;

newVersion = `${intermediateVersion}${isStable ? '-' : '.'}${suffix}`;
Expand Down

0 comments on commit 37e325f

Please sign in to comment.