@rebasepro/cli 0.19.1-canary.g5a92fa9 → 0.19.1-canary.g96b65b4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +13 -0
- package/dist/index.es.js.map +1 -1
- package/package.json +7 -7
package/dist/index.es.js
CHANGED
|
@@ -2452,6 +2452,19 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
|
|
|
2452
2452
|
`# DATABASE_URL=postgresql://rebase_app:${dbPassword}@127.0.0.1:${dbPort}/rebase?options=-c%20search_path%3Dpublic&sslmode=disable`,
|
|
2453
2453
|
`DATABASE_PASSWORD=${dbPassword}`
|
|
2454
2454
|
].join("\n"));
|
|
2455
|
+
const envExampleReference = path.join(targetDirectory, ".env.example");
|
|
2456
|
+
if (fs.existsSync(envExampleReference)) {
|
|
2457
|
+
let exampleContent = fs.readFileSync(envExampleReference, "utf-8");
|
|
2458
|
+
exampleContent = exampleContent.replace(/^DATABASE_URL=postgresql:\/\/[^\n]*$/m, [
|
|
2459
|
+
"# Commented out on purpose — that is what selects the managed database.",
|
|
2460
|
+
"# To use the docker-compose Postgres this project ships instead:",
|
|
2461
|
+
"# docker compose up -d db, then uncomment the line below in .env",
|
|
2462
|
+
"# (with DATABASE_PASSWORD from that file, not the placeholder here).",
|
|
2463
|
+
`# DATABASE_URL=postgresql://rebase_app:changeme@127.0.0.1:${dbPort}/rebase?options=-c%20search_path%3Dpublic&sslmode=disable`
|
|
2464
|
+
].join("\n"));
|
|
2465
|
+
exampleContent = exampleContent.replaceAll("@localhost:5432/rebase", `@127.0.0.1:${dbPort}/rebase`);
|
|
2466
|
+
fs.writeFileSync(envExampleReference, exampleContent, "utf-8");
|
|
2467
|
+
}
|
|
2455
2468
|
const dockerComposePath = path.join(targetDirectory, "docker-compose.yml");
|
|
2456
2469
|
if (fs.existsSync(dockerComposePath)) {
|
|
2457
2470
|
let dockerComposeContent = fs.readFileSync(dockerComposePath, "utf-8");
|