Skip to content

Commit

Permalink
Allow Github install without git
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Oct 31, 2022
1 parent dceb628 commit a7c3b46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build-plugins/get-banner.ts
Expand Up @@ -27,5 +27,10 @@ export default async function getBanner(): Promise<string> {
return (getBannerPromise ||= Promise.all([
execPromise('git rev-parse HEAD'),
fs.readFile(new URL('../package.json', import.meta.url), 'utf8')
]).then(([{ stdout }, package_]) => generateBanner(stdout.trim(), JSON.parse(package_).version)));
]).then(([{ stdout }, package_]) =>
generateBanner(stdout.trim(), JSON.parse(package_).version)
)).catch(error => {
console.error('Could not determine commit hash:', error);
return 'could not get commit';
});
}

0 comments on commit a7c3b46

Please sign in to comment.