tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gen_version (744B)


      1 #!/usr/bin/env node
      2 
      3 // Get the current git hash, and save (overwrite) it into gen/.../version.js
      4 // so it can be read when running inside the browser.
      5 
      6 /* eslint-disable no-console */
      7 
      8 require('../src/common/tools/setup-ts-in-node.js');
      9 const fs = require('fs');
     10 
     11 const myself = 'tools/gen_version';
     12 if (!fs.existsSync(myself)) {
     13   console.error('Must be run from repository root');
     14   process.exit(1);
     15 }
     16 
     17 const version = 'd5a131f3afc77be7f76bbf956db054e799f2e79d';
     18 
     19 fs.mkdirSync('./gen/common/internal', { recursive: true });
     20 // This will be copied into the various other build directories.
     21 fs.writeFileSync(
     22   './gen/common/internal/version.js',
     23   `\
     24 // AUTO-GENERATED - DO NOT EDIT. See ${myself}.
     25 
     26 export const version = '${version}';
     27 `
     28 );