Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
548 B
TypeScript
18 lines
548 B
TypeScript
import { existsSync } from "fs";
|
|
import path from "path";
|
|
|
|
/**
|
|
* Resolve VIP content files under portal (apps/nomadvip) or standalone (app/data).
|
|
*/
|
|
export function resolveVipDataFile(...segments: string[]): string {
|
|
const candidates = [
|
|
path.join(process.cwd(), "apps", "nomadvip", "app", "data", ...segments),
|
|
path.join(process.cwd(), "app", "data", ...segments),
|
|
path.join(process.cwd(), "apps", "nomadvip", "app", ...segments),
|
|
];
|
|
for (const p of candidates) {
|
|
if (existsSync(p)) return p;
|
|
}
|
|
return candidates[0];
|
|
}
|