| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -407,11 +407,21 @@ async function createDownloadAndReleases(actions, graphql) { | |||
| 407 | 407 | This only happens on build, not on dev. | |
| 408 | 408 | **/ | |
| 409 | 409 | exports.onPostBuild = () => { | |
| 410 | - const releases = require('./content/download/selected.json'); | ||
| 411 | - const latest = releases.selectedReleases[0]; | ||
| 412 | - const [name, number, version] = latest.split('-'); | ||
| 410 | + const { selectedReleases } = require('./content/download/selected.json'); | ||
| 411 | + // The PDE expects the highest build number (e.g. 1435), so pick it | ||
| 412 | + // regardless of array order and skip tags without one (e.g. processing-1.5.1) | ||
| 413 | + const build = selectedReleases | ||
| 414 | + .map((tag) => tag.match(/^processing-(\d+)-/)) | ||
| 415 | + .filter(Boolean) | ||
| 416 | + .map((match) => Number(match[1])) | ||
| 417 | + .sort((a, b) => b - a)[0]; | ||
| 418 | + | ||
| 419 | + if (!build) { | ||
| 420 | + throw new Error('latest.txt: no release with a build number in selected.json'); | ||
| 421 | + } | ||
| 422 | + | ||
| 413 | 423 | fs.writeFileSync( | |
| 414 | 424 | path.join(__dirname, 'public', 'download', 'latest.txt'), | |
| 415 | - number | ||
| 425 | + String(build) | ||
| 416 | 426 | ); | |
| 417 | 427 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments