Files
AFFAANhandClaude Opus 5 f6a54d6f93 Initial commit: Maskan CRM backend
Independent FastAPI backend for Maskan CRM.

Owns contacts, organizations, leads, pipelines, activities, products,
quotes, users, permissions, audit records and first-party integration
credentials, with Alembic migrations against PostgreSQL.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 10:28:41 +05:30

58 lines
1.3 KiB
JavaScript

const { existsSync } = require("node:fs");
const { join, resolve } = require("node:path");
const { spawnSync } = require("node:child_process");
const root = resolve(__dirname, "..");
function canRun(command) {
const result = spawnSync(command, ["--version"], {
cwd: root,
shell: false,
stdio: "ignore",
});
return result.status === 0;
}
const configured = process.env.MASKAN_CRM_PYTHON;
const localCandidates =
process.platform === "win32"
? [
join(root, ".venv", "Scripts", "python.exe"),
join(root, "..", ".venv311", "Scripts", "python.exe"),
]
: [
join(root, ".venv", "bin", "python"),
join(root, "..", ".venv311", "bin", "python"),
];
const candidates = [
configured,
...localCandidates.filter(existsSync),
process.platform === "win32" ? "python" : "python3",
"python",
].filter(Boolean);
const python = candidates.find(canRun);
if (!python) {
console.error(
"Python was not found. Create .venv or set MASKAN_CRM_PYTHON.",
);
process.exit(1);
}
const result = spawnSync(python, process.argv.slice(2), {
cwd: root,
env: process.env,
shell: false,
stdio: "inherit",
});
if (result.error) {
console.error(result.error.message);
process.exit(1);
}
process.exit(result.status ?? 1);