1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-22 05:42:55 +02:00
Files
nes.css/scripts/getBuildData.js

25 lines
600 B
JavaScript

const git = require('git-rev-sync'); /* eslint-disable-line import/no-extraneous-dependencies */
module.exports = (isCompiled = false) => {
let buildData = '';
if (git.branch() !== 'master') {
if (isCompiled) {
buildData += `
Build Date: ${(new Date()).toISOString()}
Node Version: ${process.version}`;
}
buildData += `
Branch: ${git.branch()}
Commit: ${git.long()}`;
if (process.env.CIRCLECI) {
buildData += `
Build Number (CircleCI): ${process.env.CIRCLE_BUILD_NUM}`;
}
}
return buildData.replace(/^ +/gm, ' ');
};