diff --git a/skills/baoyu-post-to-x/scripts/x-utils.ts b/skills/baoyu-post-to-x/scripts/x-utils.ts index 4ad305d..fe96cc5 100644 --- a/skills/baoyu-post-to-x/scripts/x-utils.ts +++ b/skills/baoyu-post-to-x/scripts/x-utils.ts @@ -70,6 +70,8 @@ export function findChromeExecutable(candidates: PlatformCandidates): string | u } export function getDefaultProfileDir(): string { + const override = process.env.X_BROWSER_PROFILE_DIR?.trim(); + if (override) return path.resolve(override); const base = process.env.XDG_DATA_HOME || path.join(os.homedir(), '.local', 'share'); return path.join(base, 'x-browser-profile'); } @@ -79,6 +81,8 @@ export function sleep(ms: number): Promise { } export async function getFreePort(): Promise { + const fixed = parseInt(process.env.X_BROWSER_DEBUG_PORT || '', 10); + if (fixed > 0) return fixed; return new Promise((resolve, reject) => { const server = net.createServer(); server.unref();