flex-template-web/scripts/config.js
2019-01-17 12:44:00 +02:00

27 lines
627 B
JavaScript

const fs = require('fs');
const chalk = require('chalk');
const createEnvFile = () => {
fs.copyFileSync('./.env-template', './.env', err => {
if (err) throw err;
});
};
const run = () => {
if (fs.existsSync(`./.env`)) {
console.log(
`.env file already exists. You can edit the variables directly in that file. Remember to restart the application after editing the environment variables!`
);
} else {
console.log(
`You don't have .env file yet. With this tool you can configure required enviroment variables and create .env file automatically.`
);
createEnvFile();
}
};
run();