This release groups multiple feature additions and structural stability fixes: - feat(marketplace): API routes to enable/disable local plugins via UI (Minor) - feat(cli): interactive publishing and global org configuration persistence (Minor) - fix(css): resolve parsing errors in PluginsTab stylesheet (Patch) - fix(engine): fix wwv-data-engine dependency resolution and host mounts (Patch) - fix(db): resolve P1001 database connection issues in docker loopback (Patch) - chore(ci): revert dynamic edition runtime injection to static build args
35 lines
964 B
TypeScript
35 lines
964 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
|
|
let dbUrl = process.env.DATABASE_URL;
|
|
|
|
if (!dbUrl) {
|
|
try {
|
|
const envLocalPath = path.resolve(process.cwd(), ".env");
|
|
if (fs.existsSync(envLocalPath)) {
|
|
const envContent = fs.readFileSync(envLocalPath, "utf8");
|
|
const match = envContent.match(/^DATABASE_URL=["']?(.*?)["']?$/m);
|
|
if (match) {
|
|
dbUrl = match[1].trim();
|
|
}
|
|
}
|
|
if (!dbUrl) {
|
|
const envPath = path.resolve(process.cwd(), ".env");
|
|
if (fs.existsSync(envPath)) {
|
|
const envContent = fs.readFileSync(envPath, "utf8");
|
|
const match = envContent.match(/^DATABASE_URL=["']?(.*?)["']?$/m);
|
|
if (match) {
|
|
dbUrl = match[1].trim();
|
|
}
|
|
}
|
|
}
|
|
} catch (e) {
|
|
// Ignore
|
|
}
|
|
}
|
|
|
|
export default {
|
|
datasource: {
|
|
url: dbUrl,
|
|
},
|
|
}; |