forked from Mintplex-Labs/vector-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devSetup.js
30 lines (26 loc) · 1.11 KB
/
devSetup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const fs = require('fs');
const path = require('path');
const serverEnvTemplate = path.resolve(__dirname, 'backend/.env.example');
const serverEnv = path.resolve(__dirname, 'backend/.env.development')
const frontendEnvTemplate = path.resolve(__dirname, 'frontend/.env.example');
const frontendEnv = path.resolve(__dirname, 'frontend/.env')
const workerEnvTemplate = path.resolve(__dirname, 'workers/.env.example');
const workerEnv = path.resolve(__dirname, 'workers/.env')
if (!fs.existsSync(serverEnv)) {
console.log("Copying server env file template.");
fs.writeFileSync(serverEnv, '');
fs.copyFileSync(serverEnvTemplate, serverEnv);
console.log("Server env file created.");
}
if (!fs.existsSync(frontendEnv)) {
console.log("Copying frontend env file template.");
fs.writeFileSync(frontendEnv, '');
fs.copyFileSync(frontendEnvTemplate, frontendEnv);
console.log("Frontend env file created.");
}
if (!fs.existsSync(workerEnv)) {
console.log("Copying workers env file template.");
fs.writeFileSync(workerEnv, '');
fs.copyFileSync(workerEnvTemplate, workerEnv);
console.log("Workers env file created.");
}