1
0
Fork 0
docsearch/scripts/getBundleBanner.js
Pierre Millot aa666deccc
chore(deps): dependencies 2024-11-04 (#2335)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 18:15:51 +01:00

9 lines
412 B
JavaScript

import { execSync } from 'child_process';
export function getBundleBanner(pkg) {
const lastCommitHash = execSync('git rev-parse --short HEAD').toString().trim();
const version = process.env.SHIPJS ? pkg.version : `${pkg.version} (UNRELEASED ${lastCommitHash})`;
const authors = '© Algolia, Inc. and contributors';
return `/*! ${pkg.name} ${version} | MIT License | ${authors} | ${pkg.homepage} */`;
}