forked from elite-kode/elitebgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversionFile.js
More file actions
21 lines (17 loc) · 1.05 KB
/
versionFile.js
File metadata and controls
21 lines (17 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const path = require('path');
const fs = require('fs');
const appVersion = require('./package.json').version;
const frontendVersionFilePath = path.join(__dirname + '/frontend/src/environments/version.ts');
const frontendNodeVersionFilePath = path.join(__dirname + '/frontend/version.js');
const backendVersionFilePath = path.join(__dirname + '/backend/version.js');
const eddnListenerVersionFilePath = path.join(__dirname + '/eddn_listener/version.js');
const guildBotVersionFilePath = path.join(__dirname + '/guild_bot/version.js');
const tickListenerVersionFilePath = path.join(__dirname + '/tick_listener/version.js');
const angularSrc = `export const version = '${appVersion}';\n`;
const nodeSrc = `module.exports = '${appVersion}';\n`;
fs.writeFileSync(frontendVersionFilePath, angularSrc);
fs.writeFileSync(frontendNodeVersionFilePath, nodeSrc);
fs.writeFileSync(backendVersionFilePath, nodeSrc);
fs.writeFileSync(eddnListenerVersionFilePath, nodeSrc);
fs.writeFileSync(guildBotVersionFilePath, nodeSrc);
fs.writeFileSync(tickListenerVersionFilePath, nodeSrc);