1
0
Fork 0
firefox/dom/webgpu/tests/cts/checkout/tools/gen_version
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

28 lines
744 B
JavaScript
Executable file

#!/usr/bin/env node
// Get the current git hash, and save (overwrite) it into gen/.../version.js
// so it can be read when running inside the browser.
/* eslint-disable no-console */
require('../src/common/tools/setup-ts-in-node.js');
const fs = require('fs');
const myself = 'tools/gen_version';
if (!fs.existsSync(myself)) {
console.error('Must be run from repository root');
process.exit(1);
}
const version = '905c7cbfeaac1cf3feb4c6056dd6f3dbaa06b074';
fs.mkdirSync('./gen/common/internal', { recursive: true });
// This will be copied into the various other build directories.
fs.writeFileSync(
'./gen/common/internal/version.js',
`\
// AUTO-GENERATED - DO NOT EDIT. See ${myself}.
export const version = '${version}';
`
);