mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
- Astro and Starlight site in docs/ for https://fairrootgroup.github.io/FairMQ/ - 64 pages in eight groups: start, concepts, guides, shared memory, examples, tools, reference and project - API reference and source browser from the Doxygen XML of fairmq/ - Code samples are snippets of the repository files; the build fails when a snippet does not match - Option tables take the names, types and defaults from the code - Interactive diagrams: state machine, zero-copy transfer, region acknowledgements, session objects, topology and channel anatomy - The 404 page sends the URLs of the Doxygen site to the new pages - scripts/check-pages.mjs checks pages, snippets and links without a build; scripts/check-links.mjs checks all links in dist/ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
// Version and commit of the FairMQ checkout that the site is built from.
|
|
import { execFileSync } from 'node:child_process';
|
|
|
|
function git(cwd, ...args) {
|
|
try {
|
|
return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
} catch {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
export function buildInfo(cwd = process.cwd()) {
|
|
const commit = process.env.GITHUB_SHA || git(cwd, 'rev-parse', 'HEAD') || 'unknown';
|
|
const commitShort = commit.slice(0, 7);
|
|
const date = git(cwd, 'show', '-s', '--format=%cs', 'HEAD');
|
|
const branch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || git(cwd, 'rev-parse', '--abbrev-ref', 'HEAD');
|
|
// `git describe` gives e.g. v1.11.0-23-ge366c40; a checkout without tags gives nothing.
|
|
const describe = git(cwd, 'describe', '--tags', '--match', 'v[0-9]*', '--long');
|
|
const m = /^v(\d+)\.(\d+)\.(\d+)-(\d+)-g[0-9a-f]+$/.exec(describe);
|
|
const release = m ? `v${m[1]}.${m[2]}.${m[3]}` : '';
|
|
const ahead = m ? Number(m[4]) : -1;
|
|
let label;
|
|
if (m && ahead === 0) label = release;
|
|
else if (m) label = `v${m[1]}.${m[2]}`;
|
|
else label = 'dev';
|
|
return {
|
|
commit,
|
|
commitShort,
|
|
date,
|
|
branch,
|
|
release,
|
|
ahead,
|
|
label,
|
|
unreleased: ahead !== 0,
|
|
repo: 'https://github.com/FairRootGroup/FairMQ',
|
|
};
|
|
}
|