📝 writing docs for create public env helper
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
// These keys will not be cleared in the .env.example file
|
||||||
const PRESERVED_KEYS = [
|
const PRESERVED_KEYS = [
|
||||||
"APP_NAME",
|
"APP_NAME",
|
||||||
"APP_ENV",
|
"APP_ENV",
|
||||||
@ -11,6 +12,10 @@ const PRESERVED_KEYS = [
|
|||||||
"REDIS_PORT",
|
"REDIS_PORT",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Script to create or update the .env.example file based on the .env file.
|
||||||
|
* It preserves certain keys and clears their values in the .env.example file.
|
||||||
|
*/
|
||||||
try {
|
try {
|
||||||
const envPath = path.join(process.cwd(), ".env");
|
const envPath = path.join(process.cwd(), ".env");
|
||||||
const envExamplePath = path.join(process.cwd(), ".env.example");
|
const envExamplePath = path.join(process.cwd(), ".env.example");
|
||||||
|
|||||||
Reference in New Issue
Block a user