1
0
Fork 0
docsearch/scripts/getBundleBanner.ts
2026-07-16 14:59:00 -04:00

13 lines
443 B
TypeScript

import { execSync } from 'child_process';
export function getBundleBanner(pkg: any): string {
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} */`;
}