-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.copyconfigrc.js
21 lines (19 loc) · 963 Bytes
/
.copyconfigrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const appConfigPkg = require('./app-config/package.json');
const pkg = require('./package.json');
const {execSync} = require('child_process');
const path = require('path');
const source = path.join(pkg.name, 'content');
const currentBranch = execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
const isTagged = !!execSync('git tag -l --points-at HEAD').toString().trim();
const configBranchSelection = isTagged || currentBranch === 'main' ? 'main' : 'staging';
const distribution = process.env.DISTRIBUTION !== 'wire' && process.env.DISTRIBUTION;
const suffix = distribution || configBranchSelection;
const configurationEntry = `wire-web-config-default-${suffix}`;
const repositoryUrl = appConfigPkg.dependencies[configurationEntry];
module.exports = {
files: {
[`${source}/image/wire.svg`]: './resource/image/logo/logo.svg',
[path.join(pkg.name, '.env.defaults')]: path.join(__dirname, 'server', '.env.defaults'),
},
repositoryUrl,
};