You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gen-version.js 662B

123456789101112131415161718192021
  1. /* global __dirname */
  2. const { execSync } = require('child_process');
  3. const { writeFileSync } = require('fs');
  4. const { join } = require('path');
  5. const process = require('process');
  6. const devNull = process.platform === 'win32' ? 'nul' : '/dev/null';
  7. const commitHash = process.env.LIB_JITSI_MEET_COMMIT_HASH
  8. || execSync(`git rev-parse --short HEAD 2>${devNull} || echo development`)
  9. .toString()
  10. .trim();
  11. const outputPath = join(__dirname, '..', 'version.ts');
  12. writeFileSync(
  13. outputPath,
  14. `// This file is auto-generated during build
  15. export const COMMIT_HASH = '${commitHash}';\n`
  16. );
  17. console.log(`Generated commit hash: ${commitHash}`);